
一個(gè)超級變態(tài)的DIV+CSS
1. E[att^="string"] {property: value;} where E is a selector.
最終顯示的結(jié)果就是:在以P為標(biāo)簽里,只要他的里面包函"ho"那么它的背景就為綠的
CSS:
p[title^="ho"] {background: green;}
HTML:
<p title="home">
This paragraph should have a green background.
</p>
<p title="contact">
The attribute selector doesn’t match this paragraph.
</p>
<p title="house">
This paragraph should have a green background.
</p>
<p>
The attribute selector doesn’t match this paragraph.
</p>
<p title="hot">
This paragraph should have a green background.
</p>
2. E[att$="string"] {property: value;} where E is a selector.
最終顯示的結(jié)果就是:在以P為標(biāo)簽里,只要他的里面不包函" t ",那么它的背景就為綠的
css:
p[title$="t"] {background: green;}
html:
<p title="home">
The attribute selector doesn’t match this paragraph.
</p>
<p title="contact">
This paragraph should have a green background.
</p>
<p title="house">
The attribute selector doesn’t match this paragraph.
</p>
<p>
The attribute selector doesn’t match this paragraph.
</p>
<p title="hot">
This paragraph should have a green background.
</p>
最終顯示的結(jié)果就是:在以P為標(biāo)簽里,只要他的里面模糊包函" ont ",那么它的背景就為綠的
css:
p[title*="ont"] {background: green;}
html:
<p title="home">
The attribute selector doesn't match this paragraph.
</p>
<p title="contact">
This paragraph should have a green background.
</p>
<p title="house">
The attribute selector doesn't match this paragraph.
</p>
<p>
The attribute selector doesn't match this paragraph.
</p>
<p title="hot">
The attribute selector doesn't match this paragraph.
</p>
您發(fā)布的評論即表示同意遵守以下條款:
一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權(quán)益;
二、不得發(fā)布國家法律、法規(guī)明令禁止的內(nèi)容;互相尊重,對自己在本站的言論和行為負(fù)責(zé);
三、本站對您所發(fā)布內(nèi)容擁有處置權(quán)。