【问题标题】:CSS overflow-y:scroll; works in chrome but not in edge on html tagCSS 溢出-y:scroll;适用于 chrome 但不适用于 html 标签的边缘
【发布时间】:2021-07-12 21:02:00
【问题描述】:

我正在处理希望使整个页面可滚动的网页,当我在 html 标记上添加 overflow-y:scroll 时,它在 Chrome 浏览器中可以完美运行,但在 Edge 和 Firefox 中却不行。

我该如何解决这个问题?

这是 index.html

{% extends 'base.html' %}
    {% block content %}
    <div class="container-fluid">
    <div class="col-md-auto col-sm-auto col-lg-auto position-relative mx-auto">
        <h1 class="postmod">მოგესალმებით ციფრული ლიტერატურის 
    პორტალზე</h1>
    </div>


</div>

<div class="container-fluid mainnews">
    <div class="col-md-auto col-sm-auto col-lg-auto position-relative">
        <h2 class="postmod">სიახლეები</h2>
         {% for new in news %}
        <h4>{{ new.title }}</h4>
        <p>{{ new.message }}</p>
    {% endfor %}

    </div>

</div>
    {% endblock %}

这是master.css文件

html {
  min-height: 0px;
  height: 100%;
  width: 100%;
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  position: fixed;
  overflow:scroll;
  


}

body{

    background-color: transparent;
    color: #0d6efd;
    overflow-y:scroll;

    height: 100%;
    min-height: 0px;

}

【问题讨论】:

  • 请在您的问题中提供足够的示例代码,以便我们自己查看问题。
  • 按要求添加伴侣????
  • 您使用的是哪个版本的 Edge?我用你的代码做测试,把一些段落放在'

    '中,它在所有浏览器中都运行良好。 Edge 和 Chrome 没有区别,都可以很好地滚动。请提供可以重现问题code snippet

标签: html css scrollbar overflow microsoft-edge


【解决方案1】:

根据caniuse.comoverflow-y:scroll 适用于 Microsoft Edge。

它使用相同的代码进行测试,文本只是复制和粘贴。

【讨论】:

  • 该错误是由引导容器错误使用引起的,谢谢
【解决方案2】:

您可能使用的是旧版本的 Edge 和 Firefox。检查此链接以查看哪些版本支持溢出-y:www3schools - overflow-y

【讨论】:

  • 我正在使用最新版本的 chrome 和 edge
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-09-10
  • 1970-01-01
  • 2018-05-05
  • 2015-02-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多