css3多類別選取器使用詳解

來源:互聯網
上載者:User
這次給大家帶來css3多類別選取器使用詳解,使用css3多類別選取器的注意事項有哪些,下面就是實戰案例,一起來看一下。

下面一段代碼給大家介紹css3類別選取器之結合元素選取器和多類別選取器用法,具體代碼如下所示:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>Title</title>    <style>        .p2{font-size:30px;}        /*結合元素選取器*/        p.p1{color:rebeccapurple;}        /*多類別選取器*/        .p1.p2{font-style: italic;}    </style></head><body>    <p class="p1">看我</p>    <p class="p1">我就是我</p>    <p class="p2">我是一段文字</p>    <p class="p1 p2">我還是斜體字</p></body></html>

相信看了本文案例你已經掌握了方法,更多精彩請關注php中文網其它相關文章!

推薦閱讀:

Bootstrap實現價格表

CSS怎麼處理瀏覽器的預設樣式

CSS有幾種實現三欄布局的方法

相關文章

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.