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

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

WBOY
Release: 2016-06-24 11:25:13
Original
1197 people have browsed it

一.  以“字符串”开头

两种用法的区别是:

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>
Copy after login

3. css代码

a)

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

b)

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

 

4. 效果:

a)

b)

 

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