
一個(gè)超級(jí)變態(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>
呢 稱(chēng): | |
表 情: | |
內(nèi) 容: |
評(píng)論內(nèi)容:不能超過(guò) 1000 字,需審核,請(qǐng)自覺(jué)遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。 |
驗(yàn)證碼: | |
您發(fā)布的評(píng)論即表示同意遵守以下條款:
一、不得利用本站危害國(guó)家安全、泄露國(guó)家秘密,不得侵犯國(guó)家、社會(huì)、集體和公民的合法權(quán)益;
二、不得發(fā)布國(guó)家法律、法規(guī)明令禁止的內(nèi)容;互相尊重,對(duì)自己在本站的言論和行為負(fù)責(zé);
三、本站對(duì)您所發(fā)布內(nèi)容擁有處置權(quán)。