被覆盖的风格

时间:2012-07-02 06:33:57

标签: html css css3

以下是我内置页面中的HTML:

<div class="notes quotes-notification member-savings f-left">
<h2>My Notifications</h2>
<ul>
<li><b>need to modify the HTML a little more than on the other pages you worked your account. </li>
<li>An <a href="#">answer has been posted</a> to a question you submitted.</li>
<li>A shop responded to a <a href="#">review you posted</a>.</li>
</ul>
</div>

quotes-notificationmember-savings都有不同的css,如下所示:

.member-savings {
    width: 19%;
    margin-right: 1.6%; 
    border: 2px solid #0c86c9;
}
.quotes-notification{
    width: 32%; 
}

在页面上,我需要Notification块将宽度设置为32%,但此块将宽度视为19%并覆盖32%。 在这里,我无法删除班级member-savings有没有办法忽视19%?

1 个答案:

答案 0 :(得分:0)

!important指定width:32%;是实现此目标的一种方法。但这不是推荐的做法。另一种方法是尝试增加quotes-notification的CSS扩展的特异性。即代替:

.quotes-notification{
    width: 32%; 
}

尝试类似:

body div.quotes-notification {
    width: 32%; 
}
相关问题