首页 > 代码库 > css两个紧挨着的css选择器修饰同一个元素
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>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。