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”的多个元素都水平居中对齐

  • 相关阅读:
    求树的某一层的节点最多
    快排 PAT 1101
    PAT 1098
    PAt 1099
    多项式求和
    pat 1100
    getline 函数
    数字的标准写法
    线性回归
    HTTP 中状态码 302的使用场景
  • 原文地址:https://www.cnblogs.com/lanchong/p/1781584.html
Copyright © 2011-2022 走看看