【问题标题】:Show footer at the bottom of the page always problem with Internet Explorer 11在页面底部显示页脚总是 Internet Explorer 11 的问题
【发布时间】:2021-01-29 02:27:30
【问题描述】:

我正在开发一个带有Visual Studio 2019C#.NET Framework 4.7ASP.NET 网站

我在母版页上插入了这个css class,因为我的所有页面都有垂直滚动条,我想始终在页面底部显示<footer>

在浏览器Google ChromeMicrosoft Edgecss class 工作正常,但在浏览器Internet Explorer 11 上,页脚文本会随着网页移动。

我该怎么做?

footer{
 position:fixed;
 bottom:0;
}

<div>
    <footer>
        <p style="font-size:20px">My Company</p>
    </footer>
</div>

【问题讨论】:

标签: html css asp.net internet-explorer-11 footer


【解决方案1】:

实际上所有浏览器都可以正常工作,只需确保正确设置 CSS。

  • style 中的 CSS head
  • CSS 内联

演示:

<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
    <style>
      .p{
        height: 200vh;
        background:red;
      }
      footer{
        position:fixed;
        bottom:0;
        background: yellow;
      }
    </style>
  </head>
  <body>

    <h1>This is a Heading</h1>
    <p class="p">This is a paragraph.</p>
    <div>
        <footer>
            <p style="font-size:20px">My Company</p>
        </footer>
    </div>

  </body>
</html>

IE11 上的结果(你可以滚动,因为标题的一半):

【讨论】:

    猜你喜欢
    • 2011-10-24
    • 2012-06-04
    • 2019-11-09
    • 2015-11-14
    • 2020-03-22
    • 1970-01-01
    • 2015-01-02
    • 2013-11-20
    • 2019-08-18
    相关资源
    最近更新 更多