/*多选选择器 ,使用所有奇数的择器孩子(2n+1)*/
/*多选选择器 ,id=""*/
#abc {
color: red;
}
/*通用选择器 全部的使用*/
* {
color: red;
}
/*选择父元素中的子元素*/
.cet ol li {
color: blue;
}
/*选择第一个子元素*/
ol >a {
color: blue;
}
/*并集选择器*/
div ,元素p写错了,择器经常使用
/*未访问的链接*/
a:link {
color: black;
}
/*已被访问的链接*/
a:visited {
color: chocolate;
}
/*鼠标经过的链接*/
a:hover {
color: red;
}
/*鼠标按下未弹起的链接*/
a:active {
color: yellow;
}
4.focus选择器表单光标
input:focus {
background-color: yellow;
color: red;
}5.属性选择器(10)
/*选择表单的中的value 属性值*/
input[value] {
color: crimson;
}
/*选择是表单的样式桑文本框还是密码框*/
input[type=text] {
color: blue
}
/*选择必须包含的 abc开头的属性*/
div[class^=abc] {
color: blue;
}
/*选择必须是 abc 结尾的属性*/
div[class$=abc] {
color: crimson;
}
/*选择只要包含 abc的任意属性*/
div[class*=abc] {
color: lightgreen;
}
类选择器 ,content属性必填*/
div::after {
content: '我';
}
/*伪元素的择器鼠标样式*/
.tudu:hover::before {
content: '我';
}
伪元素定义
文档中找不到的
before和atter 是一个盒子,content属性必填*/
div::before {
content: '我';
}
/*后面增加一个盒子 ,使用伪类选择器 权重都是择器 106.结构选择器(12)
/*第一个子元素*/
ul li:first-child {
background-color: lime;
}
/*最后一个元素*/
ul li:last-child {
background-color: lime;
}
/*单个选择器,第五个开始选(n+5)*/
/*多选选择器,使用不按按照标准流*/
/*权重 12*/8.伪元素选择器(1)
/*前面增加一个盒子 ,就不显示了*/
section div:nth-of-type(1) {
color: lime;
}
/*先确定元素 ,使用(第几个元素)*/
ul li:nth-child(3) {
background-color: lime;
}
/*多选选择器 ,择器5的使用倍数(5n)*/
/*多选选择器,所有偶数的择器孩子(2n)*/
/*多选选择器,2.基础选择器
/*类别选择器, class=""*/
.abc {
color: red;
}
/*单个选择器 ,不能直接设置宽高加浮动,根据元素 ,或者转化为块级元素 display: inline-block;
伪元素权重是 1
7.nth-child和nth-of-type区别
<section>
<p>光头强</p>
<div>熊大</div>
<div>熊二</div>
</section>
section p:nth-child(1) {
color: lime;
}
/*规规矩矩选取第几个孩子 ,选择该元素的第一个孩子 ,属性选择器 ,.adc {
属性
}
3.伪类选择器(链接样)
/未访问的链接/,确定元素
,奇数(odd)*/
/*多选选择器
,奇数(even)*/
/*多选选择器,p,/已被访问的链接//鼠标经过的链接/,是行内元素,
