gpt4 book ai didi

html - TD背景不显示

转载 作者:太空宇宙 更新时间:2023-11-04 15:23:01 25 4
gpt4 key购买 nike

我有这个 CSS 样式:

table.shadowed {
border-spacing: 0px;
}

table.shadowed td {
padding: 0px;
}

table.information {
width: 500px;
}

table.information td.ul {
background-image: url('img/information_bg_upper_left.png');
background-position: bottom;
background-repeat: no-repeat;
width: 10px;
height: 36px;
}

table.information td.u {
background-image: url('img/information_bg_upper.png');
background-position: bottom;
background-repeat: repeat-x;
}

和这个 HTML 代码片段:

<table class="shadowed information">
<tr>
<td class="ul"></td>
<td class="u"></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>

它的问题是,对我来说,中心 TD 的背景在 Firefox 中可以很好地看到,但在 Chrome 或 Opera 中则不能。

这很有趣,因为我设置了repeat-x

那么您有任何答案吗?为什么会这样?如何在不设置具体尺寸的情况下为表格单元格设置背景?

谢谢,Áron。

最佳答案

为了使背景可见,单元格必须填充文本之类的内容,或者设置宽度和高度,否则它会折叠并且无法看到背景。

关于html - TD背景不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14364623/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com