【问题标题】:I have a vertical scrollbar with overflow set to auto and height to 100%我有一个垂直滚动条,溢出设置为自动,高度设置为 100%
【发布时间】:2015-10-26 12:13:35
【问题描述】:

我们在使用 Microsoft Edge 的网站中遇到问题。一些垂直滚动条在 .ic3-report-content-container 中可见。查看网站here

CSS 是:

.ic3-report-content-container {
    height: 100%;
    overflow:auto;
}

为什么高度为 100% 时,Edge 会显示垂直溢出?

容器 div - 父级 .ic3-report-editor - 具有正确的高度。不知何故,这个 div 的高度变小了(没有边框、没有填充、没有边距......)

删除溢出或放置overflow-x:auto; 和overflow-y:hidden; 可以解决此问题。这是正常现象,还是 Edge 错误?

【问题讨论】:

  • 如果元素设置了内边距和/或边距,它们将添加到元素的高度,除非您使用box-sizing: border-box;
  • 请在您的问题中包含足够的代码来重现问题,而不是链接到外部网站。

标签: html css microsoft-edge


【解决方案1】:

div.ic3-report-content-container的内部内容超出了框的边界,所以简单添加:

.ic3-report-content-container {overflow: hidden;}

摆脱滚动。

【讨论】:

  • 这有点扯,问题是为什么 ic3-report-content-container 的高度与 ic3-report-editor 的高度不同,即使高度设置为 100%
  • 一般情况下不能设置100%的高度,看这里stackoverflow.com/questions/6158975/css-100-height-layout
  • 不确定是否跟进,它在 Chrome、Firefox、Safari、IE10 上运行。这只是我们在使用 Edge 时遇到的问题
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-16
  • 1970-01-01
相关资源
最近更新 更多