close



支援CSS3 以上

用法::last-of-type
說明:
此tag的最後一個tag套用樣式

css定義:
  p tag 的最後一個tag套用樣式
p:last-of-type {
    background: lime;
}
注意事項:


程式:
<!DOCTYPE html>
<html>
<head>
<title>css3 Selector last-of-type 套用樣式</title>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<style type="text/css">
p:last-of-type {
    background: lime;
}
</style>
</head>
<body>
<h5>明細</h5>
<p>name:</p>
<p>所在地:</p>
<p>css3 Selector last-of-type 套用樣式</p>
</body>
</html>

圖1:




測試結束~
如果還不了解可參考:w3schools CSS Selector Reference


感謝~




 






 
















其它文章

arrow
arrow

    PG Levin Li 發表在 痞客邦 留言(0) 人氣()