属性选择器1

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!--属性选择器-->
<style>
/*[id]{*/
/*color:blue;*/
/*}*/
/*[class]{*/
/*color:red;*/
/*}*/
/*[class="outer2"]{*/
/*color:rebeccapurple;*/
/*} !*不起作用?*!*/
/*p[class="outer1"]{*/
/*color:red;*/
/*}*/
[star]{
color:royalblue;
}
</style>

</head>
<body>
<div class="outer1">hello div1</div>
<p class="outer1">hello p tag</p>
<div class=="outer2">hello div2</div>
<div class=="outer3" star="comeup">hello div3</div>
<div id="id">id tag</div>

</body>
</html>

猜你喜欢

转载自www.cnblogs.com/startl/p/12157804.html