html - div "style=resize:both"无法在 chrome 中缩小(但它在 firefox 中有效)

标签 html css google-chrome

我有以下 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/

相关文章:

html - 使嵌套的 div 拉伸(stretch)到父高度

javascript - 在 AJAX 请求后,Chrome 在 HTTP 205 响应上下载重新加载的页面

javascript - 如何在函数 chrome.extension.sendRequest 之外传递对象

CSS header 位置 :fixed causing body div to dissappear

html - 转换后 onclick 仅针对元素的一半。如何解决?

css - 为什么 css 对象要以前缀 o- 开头,而组件要以 c- 开头?

google-chrome - 添加到 Google Chrome 扩展程序的 “right-click” 菜单

javascript - 防止 href ="#"链接更改 URL 哈希

html - 如何在 Ruby on Rails 中截断超链接文本而不是超链接本身?

html - 对齐底部在 flex box 中不起作用