CSS的三种选择器
1.选择器
class选择器
id选择器
位置选择器**
2代码
HTML文件
<body>
<div>
<input class="select" placeholder="请选择默认的浏览器" required />
<ul>
<li>百度</li>
<li class="xinlang">新浪</li>
<li id="guge">谷歌</li>
<li>搜狐</li>
<li>夸克</li>
</ul>
</div>
</body>
css文件
div{
border: 2px solid #000000;
width: 300px;
color: blue;
margin-left: 8.125rem;
padding: 0.625rem;
height: 8.875rem;
background-image: url(…/img/timg.jpg);
background-size: cover;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
padding-left: 20px;
padding-right: 20px;
}
.select{
width: 200px;
}
.xinlang{
width: 100px;
background: gray;
}
#guge{
width: 100px;
background: red;
}
li:nth-child(5)
{
width: 100px;
background: yellow;
}
3.结果