Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.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
Html <;tr>;边框顶部工作,但不包括边框底部_Html_Css_Css Tables - Fatal编程技术网

Html <;tr>;边框顶部工作,但不包括边框底部

Html <;tr>;边框顶部工作,但不包括边框底部,html,css,css-tables,Html,Css,Css Tables,问题就在这里。我有自己的代码,这样我就可以在每个项的顶部和底部看到边框。但是,我只看到底部的内容,除了顶部元素 .tstyle1 { margin: 10px 0 0 30px; width: 950px; } .tstyle1 tr { height: 120px; border-bottom: 1px solid black; border-collapse: separate; border-top: 1px solid black;

问题就在这里。我有自己的代码,这样我就可以在每个
项的顶部和底部看到边框。但是,我只看到底部的内容,除了顶部元素

.tstyle1 {
    margin: 10px 0 0 30px;
    width: 950px;
}

.tstyle1 tr {
    height: 120px;
    border-bottom: 1px solid black;
    border-collapse: separate;
    border-top: 1px solid black;
    border-bottom: 1px solid orange;
}

.tstyle1 td {
    border: none;
}
这是重新创建的问题。 试试看


添加
显示:块
到您的
.tstyle1 tr

问题在于您的边框底部定义只是覆盖了边框顶部定义。所以下面的颜色没有显示出来。尝试设置
边框底部:无
,您将看到顶部边框显示


@Pricey的建议有点神奇。

这是个坏主意,因为表行是表行而不是块元素。这可能会导致意外的副作用。