技术文章分类(180)

技术随笔(11)

html元素实现多个class共同调控元素属性

 

在元素class里面继承多个classname,用空格分隔即可

<div class="parentDiv tableCell">
       <div class="childDiv"></div>
</div>

 

这里注意:写在后面优先级高。

 .parentDiv{width:60%;background-color: #00ff00;}
 .tableCell{width: 90%;}

 

这里也是:写在后面的优先级高

<link href="css/test1.css" type="text/css" rel="stylesheet">
<link href="css/test2.css" type="text/css" rel="stylesheet">

 

posted @ 2014-05-05 09:01  坤哥MartinLi  阅读(483)  评论(0编辑  收藏  举报