【问题标题】:Bottom 0 is not working On Internet Explorer 11底部 0 在 Internet Explorer 11 上不起作用
【发布时间】:2020-10-26 20:08:06
【问题描述】:

我有一个位置:固定和底部:0 的按钮;这在除 IE 11 之外的所有浏览器上都可以 - 该按钮未固定在视口底部,而是悬挂在视口底部略上方。有想法该怎么解决这个吗?下面是代码供参考:

<!-- The HTML -->
<div class="actions">Actions</div>

/* The CSS */
.actions {
  width: 500px;
  max-width: 100%;
  margin: 0;
  position: fixed;
  -ms-position: fixed;
  bottom: 0;
  -ms-position-style: none;
  z-index: 3;
}

【问题讨论】:

  • 请提供a minimal sample to reproduce the issue。请包含相关的 html 和 css 代码。它确实可以帮助我们更好地理解问题。我们可以尝试使用 IE 11 浏览器检查和测试您的代码。仅凭您的描述,我们无法找出问题所在。感谢您的理解。
  • @YuZhou 我已经用代码示例更新了问题
  • 我在 IE 和 Chrome 中测试了你的代码。结果是一样的,我无法在 IE 中重现该问题。您可以查看the result in IEthe result in Chrome。请检查您是否遗漏了什么并编辑您的代码以使其可重现。

标签: internet-explorer css-position


【解决方案1】:

我不知道为什么会这样:我只是将通配符(*)的框大小设置为内容框,然后将按钮 div 的溢出设置为隐藏。就这样问题消失了。

【讨论】:

    【解决方案2】:

    您是否将 body 标签上的内边距和边距重置为 0。您是否也将 html 标记设置为 100% 的高度?这可能会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-09-16
      • 1970-01-01
      • 1970-01-01
      • 2014-02-15
      • 2016-10-20
      • 2019-08-12
      • 2014-08-22
      相关资源
      最近更新 更多