css标签名
一、选择器
选择器分类 | 功能介绍 |
---|---|
p | 标签选择器 |
#id | id选择器 |
.class | class选择器 |
* | 通用选择器 |
p,a | 多个标签选择器 |
p a | 后代选择器 |
p>a | 子代选择器 |
p+a | 紧挨着p后面的a选择器 |
p~a | p后面所有a选择器 |
[attribute] | 属性选择器 |
p[attribute="value"] | 属性是“value”选择器 |
p[attribute^="value"] | 属性前几个字是“value”选择器 |
p[attribute&="value"] | 属性后几个字是“value”选择器 |
p[attribute*="value"] | 属性里包含“value”选择器 |
p[attribute|="value"] | 属性由“value-”开头的选择器 |
a:link | 连接平常的状态 |
a:visited | 连接被访问过之后 |
a:hover | 鼠标放到连接上的时候 |
a:active | 连接被按下的时候 |
例子
```网页标题
文章标题
段落内容...
嵌套段落内容...
章节标题
章节内容 ...
更多内容 ...
二、属性
1、标签的属性
1)background
/* 使用 <background-color> */
background: green;
/* 使用 <bg-image> 和 <repeat-style> */
background: url("test.jpg") repeat-y;
/* 使用 <box> 和 <background-color> */
background: border-box red;
/* 将背景设为一张居中放大的图片 */
background: no-repeat center/80% url("../img/image.png");
background-image:linear-gradient//行渐变,默认对称轴是180
background:
linear-gradient(0.60turn, rgba(255, 0, 0, 0.8), rgba(255, 0, 0, 0) 70.71%),
linear-gradient(127deg, rgba(0, 255, 0, 0.8), rgba(0, 255, 0, 0) 70.71%),
linear-gradient(336deg, rgba(0, 0, 255, 0.8), rgba(0, 0, 255, 0) 70.71%);
background-image:radial-gradient(red 25%, blue 37%);//径向渐变