UI自动化(二)css选择器

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
/*选择器*/
/*通过某种特殊的写法 能够定位到我要操作的标签*/
/*id选择器*/
#i1{
height: 100px;
width: 100px;
background-color: red;
}
/*class选择器*/
.c1{
height: 100px;
width: 100px;
background-color: blue;
}
/*标签选择器 定位到所有div*/
div{
height: 100px;
width: 100px;
background-color: pink;
}
/*层级选择器*/
div span{
background-color: aqua;
}
/*id层级选择器*/
#i2 span{
background-color: aqua;
}
/*属性选择器*/
span[tcz="666"]{
background-color: red;
}
</style>
</head>
<body>
<div id="i1"></div>
<!--web开发过程中 对于css的修饰大多数都是用class-->
<div class="c1"></div>
<div></div>
<div></div>
<div>
<span>天秤座</span>
</div>
<div>
<div id="i2">
<span>天秤座</span>
</div>
</div>
<div>
<div>
<span tcz="666">天秤座</span>
</div>
</div>
</body>
</html>
posted @ 2019-02-25 17:32  狐觞  阅读(350)  评论(0编辑  收藏  举报