具有边框的表格单元格元素不尊重包含它们的单元格的垂直高度。一个孩子的边界可能会与其包含的单元格的填充(甚至边界)重叠。如何防止这种情况使单元格完全包含子元素,包括其边框?
<table>
<tr>
<td>
<span>foo bar</span>
</td>
</tr>
</table>
tr {
background: red;
}
td {
padding: 5px;
background: white content-box;
}
span {
border: 10px solid blue;
}