如何使用css命名空间来避免css冲突?

时间:2014-03-26 07:19:20

标签: css3 namespaces

pnotify.css:

.ui-pnotify-container {
background-position: 0 0;
padding: .8em;
left: 0;
width: 290px;
background-color: #fcf8e3;
margin: 0;
position: relative ;
color: #c09853;
}

中的此部分覆盖

app.css:

.alert {
width: 366px;
padding: 13px 10px;
margin-left: -183px;
margin-top: -200px;
border: 1px solid #999;
position: absolute;
top: 50%;
left: 50%;
z-index: 1060;
background-color: #e2e7eb;
color: #666666;
text-align: center;
} 

但作为临时修复,我使用了“!important”。随着项目变得越来越大,这将不是一个好的选择。请问css命名空间有用吗?我不知道该怎么做。

0 个答案:

没有答案