Home >Web Front-end >HTML Tutorial >css3 选择器的比较(一) 以字符串开头_html/css_WEB-ITnose

css3 选择器的比较(一) 以字符串开头_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:25:131198browse

一.  以“字符串”开头

两种用法的区别是:

a. 以字符串开头,需要用"-"分割开,

b. 以字符串开头,不需要任何分隔符

1. 资料

a)

b) 

2. html代码

<div class="dot-4">横线分割</div><div class="dot">字符串本身</div><div class="dottest">全字母字符串</div> <div class="dot_3">下划线分割字符串</div>

3. css代码

a)

[class|="dot"]{    border: 1px solid #000;}

b)

[class^="dot"]{   border: 1px solid #000;}

 

4. 效果:

a)

b)

 

Statement:
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