zoukankan      html  css  js  c++  java
  • css中的选择器


    简单selectors

    • id选择器
      .id { Declarations block }
      
    • class选择器
      .class { Declarations block }
      
    • 元素选择器
      element { Declarations block }
      
    • 通配符选择器
      * { Declarations block }
      

    属性选择器

    • 属性名选择器
      [attr] { Declarations block }
      
    • 属性名与属性值配对选择器
      [attr=val] { Declarations block }
      
    • 属性名与属性值配对选择器(但是值是++以空格作++为分隔符的序列中的一员)
      [attr~=val] { Declarations block }
      
    • 属性名与属性值配对选择器
      (但是值是++以var-作++为开头的字符串)
      [attr|=val] { Declarations block }
      
    • 属性名与属性值配对选择器(但是值是++以var作++为开头的字符串)
      [attr^=val] { Declarations block }
      
    • 属性名与属性值配对选择器(但是值是++以var作++为结尾的字符串)
      [attr$=val] { Declarations block }
      
    • 属性名与属性值配对选择器(但是值中包含++var++的字符串)
      [attr*=val] { Declarations block }
      

    伪选择器


    关系选择器

    • 后代选择器(A后代中匹配B的. 儿子、儿子的儿子、...)
      selectorA selectorB { Declarations block }
      
    • 父子选择器(A儿子中匹配B的)
      selectorA>selectorB { Declarations block }
      
    • 兄弟选择器(紧接着A的兄弟为B)
      selectorA+selectorB { Declarations block }
      
    • 兄弟选择器(A兄弟中匹配B的)
      selectorA~selectorB { Declarations block }
      

    同规则多选器

    commSelector1,commSelector2,... { Declarations block }
    

    参考

  • 相关阅读:
    使用python写天气预告
    beef配合ettercap批量劫持内网的浏览器
    html布局
    python 使用paramiko模块上传本地文件到ssh
    mysql一些函数的记录
    python与ssh交互
    html笔记4
    html笔记3
    html笔记2
    html笔记1
  • 原文地址:https://www.cnblogs.com/ghostr/p/6478254.html
Copyright © 2011-2022 走看看