我有以下 div:
<div style='overflow:hidden;resize:both;border:1px solid orange;'>
<div style='background-color:#aaa;width:400px;height:300px;'>
</div>
</div>
你可以在这里看到:http://jsfiddle.net/4w7zd/
如果您在 firefox 中运行它,您可以调整主 div 的大小。 (让它变大或变小) 然而,如果你在 chrome 中运行它,你只能调整大小以使其更大(更宽和更高)
有人可以告诉我如何解决这个问题,以便我可以使主 div 尽可能小(就像使用 firefox 一样)吗?
非常感谢
最佳答案
我做了一些测试,似乎内容无法在 chrome 中缩小。我已经将你的案例更新为这个
<div style='overflow:auto;resize:both;border:1px solid orange; min-height: 10px;'>
<div style='background-color:#eee;width:400px;max-height:300px; height:100%;'>
</div>
</div>
它现在似乎可以工作了:http://jsfiddle.net/4w7zd/7/
不确定这是否适合您,但它可能会为您指明正确的方向。
关于html - div "style=resize:both"无法在 chrome 中缩小(但它在 firefox 中有效),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14489361/