css记录


1、范围选择样式
h1 > strong {color:red;}

如果您不希望选择任意的后代元素,而是希望缩小范围,只选择某个元素的子元素,请使用子元素选择器(Child selector)>

2、属性过滤样式

*[title] {color:red;}

 

a[href] {color:red;}

 

a[href][title] {color:red;}

 

img[alt] {border: 5px solid red;}

3、字符串匹配样式

a[href*="w3school.com.cn"] {color: red;}

 

 


原文地址:https://www.cnblogs.com/wuguangwei/p/10947978.html