gpt4 book ai didi

css - 最大/最小宽度属性不适用于目标列

转载 作者:太空宇宙 更新时间:2023-11-03 19:00:52 29 4
gpt4 key购买 nike

我尝试调整表格列宽(下一个链接上的“作者”列 http://deploy.jtalks.org/jcommune/branches/1?lang=en)。我已将最小/最大属性添加到 .author-col 样式:

#topics-table .author-col a {
font-size: 11px;
min-width: 140px;
max-width: 140px;}

但是,目标列的宽度仍然为 418 像素。我没有看到任何其他压倒一切的宽度样式。你能帮我解决这个问题吗,谢谢你的建议。

最佳答案

min-max-width 没有为表格指定。报价 the w3c :

In CSS 2.1, the effect of 'min-width' and 'max-width' on tables, inline tables, table cells, table columns, and column groups is undefined.

如果你想为你的列实现固定宽度,你可能想尝试使用 table-layout: fixed;在你的 table 上 - 但请注意,这也会将所有其他列固定为其给定的 width

编辑:再看看你的例子,你的情况似乎要简单得多:你没有给你的表格单元格一个 width 但包含在它们中的 a .将你的 css 更改为:

#topics-table .author-col a {
font-size: 11px;
/* widths are useless here, because an <a> is an inline-element */
}
#topics-table .author-col {
/* give your .author-col a width instead */
width: 140px;
}

关于css - 最大/最小宽度属性不适用于目标列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12049452/

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