<html>
<style type="text/css">
.table { display: table;}
.tablerow { display: table-row; border:1px solid black;}
.tablecell { display: table-cell; }
</style>
<div class="table">
<div class="tablerow">
<div class="tablecell">Hello</div>
<div class="tablecell">world</div>
</div>
<div class="tablerow">
<div class="tablecell">foo</div>
<div class="tablecell">bar</div>
</div>
</div>
</html>
根据我的理解,有黑边应在每个我已经通过tablerow的指定行绘制class.But边境犯规上来。CSS显示:表中未显示边框
,我想改变row.If我“PX”指定它的高度 - 它work.But,如果我用%给它 - 不会干活尝试以下
.tablerow {
display: table-row;
border:1px solid black;
position: relative; //not affecting anything and the border disappears!!
//position: absolute; // if this is set,the rows overlaps and the border works
height: 40%; // works only if specified in px and not in %
}
某处出了问题,但我无法理解在哪里。请帮忙!
你试过指定边界的电池元件?或者它不是你想要的? –