<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem 。这将有助于其他人回答问题。
关闭 6 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem 。这将有助于其他人回答问题。
关闭 6 年前。
我有一个正在开发的 webpage。让我们忘记内容。这无关紧要。它在 Chrome、Safari 和 Firefox 中看起来不错,但在 Edge 或 Internet Explorer 中无法扩展到全宽。
如果我在他们的控制台中编写(在 jQuery 的帮助下)
$('body').width($(window).width())
body延伸到全屏宽度,又ok了。我一直在尝试通过控制台调试页面,但一直没有找到原因。
引用中页面的 DOM 作为源。
只有当屏幕宽度超过 990 时才会发生这种情况(由于我使用的媒体查询)。
最佳答案
应用于 html
元素的 CSS 选择器 .svg
告诉它是一个带有 display: inline-block;
。如果您从 .svg
中删除 display
属性或将值更改为 block
页面将适本地填充浏览器视口(viewport)。
有问题的 CSS 选择器。
.svg {
display: inline-block; /* <= the problem */
background: 0 0;
border: none;
}
据我所知,您正在使用 Modernizr 进行一些特征检测,并将 .svg
类添加到 html
中,您可以创建自己的 。 svg
用于某些其他目的,不知道 Modernizr 添加了 .svg
到 html
。
如果以上为真,则更改/重命名/覆盖 CSS 选择器。如果更改/重命名,请更新最初使用 .svg
的元素。
关于html - 为什么 html 页面的正文在 Edge 和 IE 中不能扩展到全宽但对于所有其他浏览器都可以?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43145661/
相关文章:
javascript - 如果内部链接有空 href,则隐藏父 div
html - 如何使用 WebView 加载 Google Play 页面?
html - 为什么 CSS 不能与 apache2+mod_wsgi+python3+bottle 一起工作?
html - Internet Explorer 8 - 打印页面的标题
html - HTML iframe可以继承css和javascript数据吗
jquery - 将对象叠加到 bootstrap Carousel 上
html - :active and :focus on anchor is not working for IE and Mozilla