Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css Can';我的自定义样式不能被WordPress主题使用_Css_Wordpress - Fatal编程技术网

Css Can';我的自定义样式不能被WordPress主题使用

Css Can';我的自定义样式不能被WordPress主题使用,css,wordpress,Css,Wordpress,我正在尝试将一个表的自定义样式应用到我正在使用的wordpress主题,但我似乎无法使该表使用我的自定义样式。我是否做了一些我所遗漏的根本错误的事情 以下是我的编辑类的表单代码: <table class="edit"><tr><td><form action="" method="post"><button type="submit" class="link"><span>Form Approve</span>

我正在尝试将一个表的自定义样式应用到我正在使用的wordpress主题,但我似乎无法使该表使用我的自定义样式。我是否做了一些我所遗漏的根本错误的事情

以下是我的编辑类的表单代码:

<table class="edit"><tr><td><form action="" method="post"><button type="submit"
class="link"><span>Form Approve</span>   </button></form>&nbsp;|&nbsp;<form action=""
method="post"><button type="submit" class="link"><span>Form Delete</span></button></form>
</td></tr></table>


//Wordpress theme style 

table {
border-collapse: collapse;
margin-bottom: 15px; 
}

table th {
background:#eee;
border: 1px solid #fff;
padding: 10px; 
}

table tr {
background:#f5f5f5;
}

table td {
border: 1px solid #fff;
padding: 10px; 
}



//MY CUSTOM STYLING

.edit table {
border-collapse: collapse;
margin-bottom: 2px; 
}

.edit table th {
background:#eee;
border: 1px solid #ffffff;
padding: 0px; 
}

.edit table tr {
background:#ffffff;
}

.edit table td {
border: 1px solid #ffffff;
padding: 2px; 
}
表单审批|表单删除
//Wordpress主题风格
桌子{
边界塌陷:塌陷;
边缘底部:15px;
}
表th{
背景:#eee;
边框:1px实心#fff;
填充:10px;
}
表tr{
背景:#f5;
}
表td{
边框:1px实心#fff;
填充:10px;
}
//我的自定义样式
.编辑表格{
边界塌陷:塌陷;
边缘底部:2px;
}
.编辑表格th{
背景:#eee;
边框:1px实心#ffffff;
填充:0px;
}
.编辑表格tr{
背景:#ffffff;
}
.编辑表格td{
边框:1px实心#ffffff;
填充:2px;
}

.edit table
不存在(这将是另一个元素中具有“edit”类的表),您应该使用
.edit
table.edit
。例如:

.edit {
border-collapse: collapse;
margin-bottom: 15px; 
}

.edit th {
background:#eee;
border: 1px solid #fff;
padding: 10px; 
}

除了wordpress模板样式与自定义样式完全相同之外,我真的无法告诉您出了什么问题

我不认为你真的需要编辑类,你可以不使用它就覆盖样式。编辑会在表格后面,所以看起来像这样

table.edit {
border-collapse: collapse;
margin-bottom: 15px; 
}