zoukankan      html  css  js  c++  java
  • CSS 选择器分类

    CSS 选择器分类

       普通选择器:使用HTML元素标签座位选择器。

          如:  p{ font-size:24px; }

       派生选择器:通过依据元素在其位置的上下文关系定义样式,是标记更加简洁。

          如:  h2 strong{color:bule;}

              <h2>The strongly emphasized word in this subhead is<strong>blue</strong>.</h2>

              // h2 strong影响以上的blue文本。

       id 选择器:为标记特定id的HTML元素指定特定的样式。

          如:   #red {color:red}

               <p id="red">这个段落是红色。</p>  //id为red的元素的字符为红色。

       类选择器:类选择器以一个点号显示。

          如:      .center {text-align: center}

              <h1 class="center">This heading will be center-aligned</h1> 

               //class为“center”的多个元素都水平居中对齐

  • 相关阅读:
    找“水王”
    用户体验评价
    学习进度12
    个人冲刺10
    学习进度13
    学习进度11
    个人冲刺9
    myeclipse中js报错
    安卓调用三个系统app(打电话,发短息,打开网页)
    关系图绘制详解
  • 原文地址:https://www.cnblogs.com/lanchong/p/1781584.html
Copyright © 2011-2022 走看看