CSS 偽類

來源:互聯網
上載者:User

個人認識:css偽類即對某個元素的不同狀態提供表現控制。

a:link {color: #FF0000}/* 未訪問的連結 */a:visited {color: #00FF00}/* 已訪問的連結 */a:hover {color: #FF00FF}/* 滑鼠移動到連結上 */a:active {color: #0000FF}/* 選定的連結 */這些是超連結的偽類

p:first-child 偽類的意思是作為副元素的第一個p元素,你的表現如何。

 

<html><head><style type="text/css">p:first-child {  color: red;  } </style></head><body><p>some text</p><p>some text</p></body></html>  匹配第一個p元素! :lang偽類 為不同語言定義樣式。<html><head><style type="text/css">q:lang(no)   {   quotes: "~" "~"   }</style></head><body><p>文字<q lang="no">段落中的引用的文字</q>文字</p>為名為no的語言定義引號。</body></html>
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.