Home > Web Front-end > HTML Tutorial > CSS3 [attribute^=value] 选择器_html/css_WEB-ITnose

CSS3 [attribute^=value] 选择器_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:18:20
Original
1021 people have browsed it

定义和用法

[attribute^=value] 选择器匹配元素属性值带指定的值开始的元素。

 

浏览器支持

所有主流浏览器都支持[attribute^=value] 选择器。

注意: [attribute^=value]在IE8中运行,必须声明

 

实例

设置class属性值以"test"开头的所有div元素的背景颜色:

div[class^="test"]{background:#ffff00;}
Copy after login

在线运行

 

 

相关阅读:

  • CSS 参考手册
  • CSS 选择器
  • CSS 教程
  • source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template