首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

CSS选择器基础札记

2012-09-05 
CSS选择器基础笔记CSS selectors1)[attribute] base on Attributea[href] { text-decoration: none }2)[a

CSS选择器基础笔记
CSS selectors

1)[attribute] base on Attributea[href] { text-decoration: none; }2)[attribute=val] base on the Value of an attributea[href="www.iteye.com"]{ text-decoration: none; }3)[attribute~=val] contain the space-separated attribute somewhere in the valuea[title~="tv hd digital"] { text-decoration: none; }/* if title's value contains the word 'tv' or 'hd' or 'digital', then apply the CSS */4)[attribute|=val] contain the attribute with a hyphen, must start with the valuea[title|="apple"] { color: red; }/* <a title="apple-banana">link</a> */CSS31)[attribute^=val] attribute’s value begins with vala[href^="mailto:"] { color: red; }2)[attribute$=val] attribute’s value ends with vala[href$='.rss'] { color: red; }3)[attribute*=val] attribute value is anywhere within vala[href *="username"] { color: red; }

热点排行