微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html – overflow:scroll;在

为什么CSS属性溢出:scroll;不在< td>中工作,而overflow:hidden;效果很好?
<table border="1" style="table-layout:fixed; width:100px">
  <tr>
    <td style="overflow:scroll; width:50px;">10000000000000000000000000000000000</td>
    <td>200</td>
    <td>300</td>
  </tr>
</table>

从CSS规范1,2,我看不出为什么.

解决方法

我有东西 from here

Andrew FedonIoUk wrote:

This is actually my question:
“One technical reason is that the overflow property does not apply to
tables.” – why? What is this reason?


我不是专家,但我相信这是
只是为了向后兼容
遗留表行为.你可以检查
自动”表布局
规格中的算法我很漂亮
肯定这个布局算法是
与溢出不兼容
财产(或更准确地说,
布局算法永远不会导致
需要任何溢出值
除了’可见’).

Yep,this is why I am asking. Seems like there are no formal reasons
why or should not be scrollable but seems like
UA vendors reached some silent agreement in this area. So is the
question.


规格同意您的尊重
到元素表格是
应该尊重溢出,虽然
至少,Mozilla似乎不行
所以.我不能回答你的问题
这个例子,虽然我还是会的
猜测答案还是有关系的
传统渲染.

main thread is here.

原文地址:https://www.jb51.cc/html/230156.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐