【问题标题】:Html body not covering full screen in case of larger screen resolutions like 2048px在 2048px 等较大屏幕分辨率的情况下,HTML 正文不会覆盖全屏
【发布时间】:2019-05-14 11:15:12
【问题描述】:

在 iPad 纵向模式或屏幕分辨率超过 1920px 的情况下,html body 会在右侧留下一个空白区域,每个元素都会在右侧显示空白区域,并且随着屏幕分辨率的增加,该区域会变宽

我在正文中将填充和边距设置为 0 此外,我已将宽度设置为 100%,但同样的问题仍然存在

body {
  line-height: 1.7;
  color: gray;
  font-weight: 400;
  font-size: 1rem;
  overflow-x:hidden;
  width: 100% !important;   }

我希望通过将上面的代码添加到正文中右侧不会有空白,但它会留下一些空间

【问题讨论】:

  • 我们无法仅凭bodyproperties 猜出它是什么
  • @Dev 你不必使用 !important
  • 请重新编辑您的问题并添加一些您尝试过的代码。

标签: html css


【解决方案1】:

试试这个

html{
    width:100%;
    height:100%;
}

【讨论】:

    猜你喜欢
    • 2022-12-12
    • 1970-01-01
    • 2011-07-19
    • 1970-01-01
    • 1970-01-01
    • 2017-12-13
    相关资源
    最近更新 更多