css禁止选取文本
时间: 2023-07-23 11:14:44 浏览: 76
你可以通过CSS的user-select属性来禁止选取文本。将其设置为none即可,示例如下:
```
body {
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
}
```
相关问题
css 禁止文本复制编写出代码
禁止文本复制的代码如下所示:-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
css常用的文本属性
CSS中常用的文本属性有以下几种:
1. font-family:设置字体族名称。可以设置多个字体,以确保在用户电脑中存在的字体可用时使用。
2. font-size:设置字体大小。
3. font-weight:设置字体粗细。
4. color:设置文本颜色。
5. text-align:设置文本对齐方式,包括左对齐、右对齐、居中对齐和两端对齐等。
6. text-decoration:设置文本装饰效果,包括下划线、删除线、上划线等。
7. line-height:设置行高。
8. letter-spacing:设置字符间距。
9. text-indent:设置首行缩进。