zoukankan      html  css  js  c++  java
  • CSS3选择器整理


    属性选择器:
    E[name] 属性名是name的元素
    *E[name=value] 属性名是name值为value元素
    E[name~=value] 包含value这个单词元素
    E[name^=value] 以value这个词开头的元素
    E[name$=value] 以value这个词结尾的元素
    *E[name*=value] 只要包含value这个东西的元素
    E[name|=value] 以value-或者纯value开头的东西

      <a href="xxxpdfxx">
      <a href="xxxdocxx">

      a[href*=pdf]{}
      a[href*=doc]{}
    ----------------------------
    结构性伪类选择器:
    * E:nth-child(n) 正好第n个 ,从1开始计数
      nth-child(odd) 奇数
      nth-child(even) 偶数
      nth-child(n) 所有数,从0开始
      nth-child(2n) 2的倍数
      nth-child(2n+1)
      nth-child(2n-1)
    E:nth-last-child(n) 倒数第n个

    E:first-child   =》  nth-child(1)
    E:last-child    =》  nth-last-child(1)

    E:nth-of-type(n) 类型的某个元素
    E:nth-last-of-type(n)
    ----------------------------
    E:disabled 不能用表单元素
    E:enabled 可用的表单元素
    E:checked 选中的表单元素

    E:empty 空元素
    E:target 被锚点锚住元素
    E:not(some) 除了some的东西元素

    ----------------------------
    文本伪类选择器:
    E:first-line 第一行文本
    E:first-letter 第一个字

    E::selection{} 选中文本 超伪类

    ::selection{} 所有

    E::after{} 之后
    E:after{}
    content:''

    E::before{} 之前

    E:before{}
      content:''

  • 相关阅读:
    CodeForces
    CodeForces
    CodeForces 718C && HDU 3572 && Constellation
    CodeForces
    USACO 5.4 tour的dp解法
    10.22~10.28一周经典题目整理(meeting,BZOJ4377,POJ3659)
    codeforces 724D
    codeforces 724C
    hdu5909 Tree Cutting
    hdu5822 color
  • 原文地址:https://www.cnblogs.com/queenie/p/4928799.html
Copyright © 2011-2022 走看看