小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

常用的偽類選擇器

 莫百百 2021-04-14

鏈接偽類選擇器

主要有以下幾類:

a:link 未訪問(wèn)鏈接時(shí)屬性 a:visited 訪問(wèn)后的屬性 a:hover 鼠標(biāo)放上去時(shí)的屬性 a:active 點(diǎn)擊后的屬性
  • 1
  • 2
  • 3
  • 4
  • 1
  • 2
  • 3
  • 4

代碼示例:

a:link {color: red}
a:visited; {color: yellow}
a:hover {color: blue}
a:active {color: orange}
<a href='#'>   這是一個(gè)a標(biāo)簽  </a>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5

結(jié)構(gòu)偽類選擇器

:first-child 第一個(gè)節(jié)點(diǎn) :last-child 最后一個(gè)節(jié)點(diǎn) :nth-child(n) 順數(shù)第幾個(gè)節(jié)點(diǎn)(2n則表示順數(shù)所有偶數(shù)位節(jié)點(diǎn)) :nth-last-child(n)逆著數(shù)第幾個(gè)節(jié)點(diǎn)(2n表示逆數(shù)所有偶數(shù)節(jié)點(diǎn))
  • 1
  • 2
  • 3
  • 4
  • 1
  • 2
  • 3
  • 4

代碼示例:

   li:first-child {color: red }
   li:last-child {color: red} 
   li:nth-child(2n) {color: red} 
   li:nth-last-child(2n) {color: red}
 <ol>
  <li> 第一個(gè)節(jié)點(diǎn) </li>
  <li>第二個(gè)節(jié)點(diǎn)</li>
  <li>第三個(gè)節(jié)點(diǎn)</li>
  <li>第四個(gè)節(jié)點(diǎn)</li>
   <li>第五個(gè)節(jié)點(diǎn)</li>
   </ol>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

目標(biāo)偽類選擇器

:target
  • 1
  • 1

代碼示例

 :target { color: red;  }
 <a href='#lianjie1'> 跳轉(zhuǎn)鏈接</a>
 <h1 id='lianjie'>target</h1>
  • 1
  • 2
  • 3
  • 1
  • 2
  • 3

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多