css两个紧挨着的css选择器修饰同一个元素

#status, .commands
{
height: 25px;
line-height: 25px;
}
.upload .commands
{
float: right;
}
.hidden
{
display: none;
}
#status
{
float: left;
font-size: 12px;
}
#status.error
{
color: Red;
width: 100%;
}
#status.info
{
color: #333;
width: 100%;
}
#status.success
{
color: green;
width: 100%;
}

 

刚刚发现,一个id选择器和一个class选择器紧挨着跟不紧挨着是有区别的,紧挨着的,是修饰同一个元素的,那些不紧挨的,是修饰某个元素下的子元素

<div style="position: relative; width: 305px; height: auto; overflow: hidden; text-overflow: ellipsis;
white-space: nowrap; -o-text-overflow: ellipsis;">
<div id="status" class="info">
</div>
</div>

 

 

 

 

posted @ 2014-05-29 18:01  巴拉比巴拉  阅读(1336)  评论(0编辑  收藏  举报