css attribute selector 属性选择器

attribute selector

The CSS attribute selector matches elements based on the presence or value of a given attribute.
CSS 属性选择器匹配存在该属性或者属性为特定值的元素

  • [attr]
    Represents an element with an attribute name of attr.

  • [attr=value]
    Represents an element with an attribute name of attr whose value is exactly value.

  • [attr~=value]
    Represents an element with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly value.

  • [attr|=value]
    Represents an element with an attribute name of attr whose value can be exactly value or can begin with value immediately followed by "-" (U+002D). It is often used for language subcode matches.

  • [attr^=value]
    Represents an element with an attribute name of attr whose value is prefixed (preceded) by value.

  • [attr$=value]
    Represents an element with an attribute name of attr whose value is suffixed (followed) by value.

  • [attr*=value]
    Represents an element with an attribute name of attr whose value contains at least one occurrence of value within the string.

  • [attr operator value i]
    Adding an i (or I) before the closing bracket causes the value to be compared case-insensitively (for characters within the ASCII range).

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,516评论 0 13
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,936评论 0 0
  • Data Visualization with D3 D3: SVG中的jQurey 1. Add Documen...
    王策北阅读 791评论 0 2
  • 1.背景 现实生产环境中,我们通常使用邮件和短信接受zabbix报警信息,但是邮件经常被工作人员搁置在角落中甚至被...
    Zero___阅读 1,450评论 0 10
  • 这是唯妳365日写作计划第7天的写作内容 撒娇似的跟室友说好想要休息一天,然后说出了放弃是容易的,坚持却很难这句话...
    xiaoyaojing121阅读 671评论 0 0