1.拓展選擇器
1.選擇第一個(gè)子元素
div>p:first-child{} /*選擇div里面第一個(gè)子元素*/
2.選擇最后一個(gè)子元素
div>p:last-child{} /*選擇div里面最后一個(gè)子元素*/
3.選擇某一個(gè)子元素
ul li:nth-child(index) even偶數(shù) odd奇數(shù)
4.不選中某個(gè)
:not(selector)//:nth-child(index)
2.Emmet語法
<!--ul>li.item*4>a[href=#]{首頁(yè)}-->
//生成
<ul>
<li class="item"><a href="#">首頁(yè)</a></li>
<li class="item"><a href="#">首頁(yè)</a></li>
<li class="item"><a href="#">首頁(yè)</a></li>
<li class="item"><a href="#">首頁(yè)</a></li>
</ul>
3.樣式寫出三角形
例如:
<style>
.sanjiao{
display: block;
height: 0;
width: 0;
border: 20px solid transparent;
border-bottom-color: red;
}
</style>
</head>
<body>
<span class="sanjiao"></span>
</body>
其中改變邊框的方向就可以改變?nèi)堑某颉?
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者