css:表格高度不配合

发布于 2024-09-06 15:47:52 字数 696 浏览 1 评论 0原文

我无法将表格“嵌入”到另一个任意高/短的 div 中:

#header table.rates {
    float: left;
    width: 210px;
    border: 1px solid black;
    border-collapse: collapse;
    padding:0;
    margin: 5px;
    font-family: Verdana, Helvetica, Arial;
    font-size: 10px;
}

#header {
    clear:both;
    float:left;
    width:100%;
    border-bottom:1px solid #000;
    background: #9c9;
    padding-top: 10px;
    padding-bottom: 10px;
    font: small-caps 40px/40px "Times New Roman", serif;
    color: #282;
}

在 html 中,它是

表格垂直扩展标题 div,无论对 tr、tdtable 元素进行多少修改都无法使其配合。我缺少什么?

I can't make a table I've 'embedded' in another div arbitrarily tall/short:

#header table.rates {
    float: left;
    width: 210px;
    border: 1px solid black;
    border-collapse: collapse;
    padding:0;
    margin: 5px;
    font-family: Verdana, Helvetica, Arial;
    font-size: 10px;
}

#header {
    clear:both;
    float:left;
    width:100%;
    border-bottom:1px solid #000;
    background: #9c9;
    padding-top: 10px;
    padding-bottom: 10px;
    font: small-caps 40px/40px "Times New Roman", serif;
    color: #282;
}

And in the html it's <div id='header'>...<table class='rates'>...

The table vertically expands the header div and no amount of tinkering with the tr, td or table elements will get it to cooperate. What am I missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疧_╮線 2024-09-13 15:47:52

抱歉,这里的网络干扰各位,问题出在

#header {
字体:小型大写字母 40px\40px“Times New Roman”、衬线体;
}

将该行修改为 font:small-caps 40px "Times New Roman", serif; 允许我根据需要访问表格的高度属性。

里尔

Sorry for the cyber-perturbation here folks, the problem was with

#header {
font: small-caps 40px\40px "Times New Roman", serif;
}

Modifying the line to font: small-caps 40px "Times New Roman", serif; allowed me access to my table's height properties, as desired.

Lille

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文