html - 为什么会溢出:hidden not working in chrome when parent div has a column-count

标签 html css google-chrome

输出应该是:

enter image description here

但是在 chrome 上我得到这个:

enter image description here

从 div1 中删除 column-count 属性可以修复它。有趣的是,如果您检查并禁用该属性然后重新启用它,一切都很好。这是 Chrome 中的错误吗?

#div1 {
  column-count: 1;
}

#div2 {
  overflow: hidden;
  background: red;
}

#div3 {
  transform: translate3d(50px, 50px, 0px);
}
<div id="div1">
  <div id="div2">
    <div id="div3">
      <img src="http://placehold.it/100x100&text=photo"/>
    </div>
  </div>
</div>

最佳答案

这不是为什么它不起作用的答案,但如果您同时需要一个讨厌的解决方法,这对我有用:

#div1 {
  column-count: 1;
  overflow-x: scroll;
}

#div2 {
  overflow: hidden;
  background: red;
}

#div3 {
  transform: translate3d(50px, 50px, 0px);
}
<div id="div1">
  <div id="div2">
    <div id="div3">
      <img src="http://placehold.it/100x100&text=photo"/>
    </div>
  </div>
</div>

🤢🤮

关于html - 为什么会溢出:hidden not working in chrome when parent div has a column-count,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56878768/

相关文章:

html - CSS 边框没有包裹整个 div 内容

angularjs cordova base href

html - 菜单接管了导致跳跃效果的子元素的高度

javascript - 卡片阴影效果不起作用(由于悬停不起作用)

java.lang.IllegalStateException : The driver executable does not exist: C:\Users\jagrelot\workspace\AntBuildExample\chromedriver. exe 与 ChromeDriver

linux - 如何解决 Ubuntu 14.04 中未满足的依赖关系问题

html - 搜索栏样式出现在本地但不在 heroku 上

html - 垫扩展面板删除边框

css - 如何根据 flexbox 顺序设置元素样式

javascript - Chrome 扩展程序可帮助学习