Html 竞争CSS样式表
我正在尝试删除特定表上的边框:Html 竞争CSS样式表,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我正在尝试删除特定表上的边框: <table class="teacher"> <tr> <td>row 1</td> <td>col 1</td> <td>col 2</td> </tr> <tr> <td>row 2</td> <td>
<table class="teacher">
<tr>
<td>row 1</td>
<td>col 1</td>
<td>col 2</td>
</tr>
<tr>
<td>row 2</td>
<td>col 1</td>
<td>col 2</td>
</tr>
</table>
我的包:
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/site.css",
"~/Content/bootstrap.css",
"~/Content/bootstrap-theme.css",
"~/Content/bootstrap-duallistbox.css",
"~/Content/jquery.dataTables.css"));
我认为这就是导致引导出现问题的原因:
.table {
width: 100%;
margin-bottom: 20px;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
padding: 8px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #ddd;
}
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #ddd;
}
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > th,
.table > caption + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > td,
.table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.table > tbody + tbody {
border-top: 2px solid #ddd;
}
.table .table {
background-color: #fff;
}
注释掉第94行中
的边框
td {
color: #000;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
text-align: left;
}
如果您曾经为表使用
和
元素,则需要记住的其他CSS片段:
第103行:
th {
color: #7c7c7b;
font-weight: 700;
font-size: large;
text-align: center;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
}
th.th2 {
color: #7c7c7b;
font-weight: 300;
font-size: large;
text-align: center;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
}
第112行:
th {
color: #7c7c7b;
font-weight: 700;
font-size: large;
text-align: center;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
}
th.th2 {
color: #7c7c7b;
font-weight: 300;
font-size: large;
text-align: center;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
}
注释掉第94行中
的边框
td {
color: #000;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
text-align: left;
}
如果您曾经为表使用
和
元素,则需要记住的其他CSS片段:
第103行:
th {
color: #7c7c7b;
font-weight: 700;
font-size: large;
text-align: center;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
}
th.th2 {
color: #7c7c7b;
font-weight: 300;
font-size: large;
text-align: center;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
}
第112行:
th {
color: #7c7c7b;
font-weight: 700;
font-size: large;
text-align: center;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
}
th.th2 {
color: #7c7c7b;
font-weight: 300;
font-size: large;
text-align: center;
/* border: 1px solid #7c7c7b; */
padding: .3em 1em;
}
您提供的JSFIDLE的CSS第90行是
td {
color: #000;
border: 1px solid #7c7c7b;
padding: .3em 1em;
text-align: left;
}
这就是造成边界的原因
因此,规则在td
元素上,而不是表上
使用
.teacher td{border:none;}
我们应该解决它
您提供的JSFIDLE CSS第90行的演示如下
td {
color: #000;
border: 1px solid #7c7c7b;
padding: .3em 1em;
text-align: left;
}
这就是造成边界的原因
因此,规则在td
元素上,而不是表上
使用
.teacher td{border:none;}
我们应该解决它
演示在谢谢我很感激!谢谢,我很感激!