【问题标题】:Random white space at bottom of page but only on mobile页面底部的随机空白,但仅在移动设备上
【发布时间】:2016-06-26 21:17:20
【问题描述】:

您好,我已经查看了几个有关如何从网页中删除空白的 stackoverflow 问题(请参阅下面的选择),但给出的解决方案对我来说都没有任何区别。奇怪的是,只有当我在手机上查看我的网站时才会出现空格。有问题的站点是:http://moduleplanner.github.io/,其对应的 github repo 是:https://github.com/Moduleplanner/Moduleplanner.github.io

感谢您的帮助。 :)

Huge White Space At Bottom Of Page

Eliminating white space at bottom of page

CSS White Space At Bottom of Page

Strange space at bottom of page on iOS

current state of whitespace

【问题讨论】:

  • 能否提供一些代码,或者问题的截图?

标签: html css


【解决方案1】:

这是 .degree 元素上的 CSS,特别是 absolute 定位。对于移动设备,将 css 更改为以下内容;

@media only screen and (max-width: 640px){
 .degree{
   min-width: 100%;
   left: 0;
   right: 0;
 }
}

或者,更好的是,以下内容;

@media only screen and (max-width: 640px){
 .degree{
   min-width: 100%;
   position: static;
 }
}

更新

@media only screen and (max-width: 640px){
 .degree{
   min-width: 100%;
   position: static;
 }

 .div.degree div.course{
   width: auto;
   max-width: 100%;
 }
}

【讨论】:

  • 感谢您的帮助,白色已大大减少,我已经移动了一些东西,现在看起来像这样: drive.google.com/file/d/0B8xFtPfGZ1mLMTRWWFhBV1FtYlk/…> 关于如何摆脱它的任何想法?谢谢。
  • @AdamPohl 您可以在原始问题中发布该图片吗?图像不会显示在 cmets 中,并且该链接会生成未找到的文件,因为它受 google 帐户保护。
  • 好了,点击current state of whitespace链接。
  • 啊,好吧,我不能从那个图像中做很多事情。你有更新的代码链接吗?
  • 这里是我的 fork 的链接,看看最后一次提交,看看我做了什么。 github.com/Huaraz2/Moduleplanner.github.io/tree/mod-code
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多