首页 > Web开发 > 详细

css选择器笔记

时间:2015-05-18 14:30:01      阅读:298      评论:0      收藏:0      [点我收藏+]
p.important {color:red;}  选择器现在会匹配 class 属性包含 important 的所有 p 元素

我们假设 class 为 important 的所有元素都是粗体,而 class 为 warning 的所有元素为斜体,class 中同时包含 important 和 warning 的所有元素还有一个银色的背景 。就可以写作:

.important {font-weight:bold;}
.warning {font-style:italic;}
.important.warning {background:silver;}

后代选择器:也叫包含选择器
h1 em {color:red;} h1下面的em
.mytop .topinner{height:681px; width:997px;margin:0 auto;} mytop下面的 topinner 最终topinner被选择
 

css选择器笔记

原文:http://www.cnblogs.com/as3lib/p/4511669.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!