在PHP页面中覆盖CSS样式

时间:2012-08-04 09:13:47

标签: php css module stylesheet whmcs

我目前正在为我们的计费软件编写一个插件模块,当您使用任何元素时,模块会自动继承模板的CSS。例如,我为表使用“datatable”元素,并根据用户当前使用的模板继承CSS样式。

我想隐藏“datatable”元素所具有的内部边框,并且我使用标签将所有CSS放入模块代码中。我不太清楚我是如何做到这一点的,但这是CSS在计费软件的模板style.css文件中的样子。

table.form {
    border: 1px solid #B8CBE7;
    background-color: #fff;
    padding: 0px;
}
table.form td.fieldlabel {
    text-align: right;
    font-weight: bold;
    padding: 5px;
    background-color: #E4ECF8;
}
table.form td.fieldarea {
    text-align: left;
    padding: 5px;
    border-bottom: 1px dashed #ccc;
}
.tablebg {
    background-color: #e9e9e9;
}
table.datatable {
    padding: 0;
    margin: 0;
}
table.datatable th {
    background-color: #f3f3f3;
    font-weight: bold;
    text-align: center;
}
table.datatable td {
    background-color: #fff;
    text-align: center;
}
table.datatable tr.rowhighlight td {
    background-color: #EFF2F9;
}
table.datatable tr:hover td {
    background-color: #EFF2F9;
}

2 个答案:

答案 0 :(得分:2)

您可以再次定义相同的数据表类,并将其边框设置为0.您只需确保此新的css定义位于实际的

之后

table.datatable { 
border: 0px;
}

答案 1 :(得分:0)

尝试在CSS样式表中附加这一行:

.datatable{ border: 0 !important; }