【发布时间】:2018-04-26 21:35:23
【问题描述】:
在小型移动设备中,我的粘性页脚下方出现了这个空白。例如,在“iPhone SE”屏幕尺寸中查看时。
我在引导示例中使用了相同的页脚和 css,但无法使空白消失。
我认为这是因为我的文本很长,然后我使用媒体查询添加了页脚高度,但它看起来不太好。我不知道如何解决它。任何指导将不胜感激。
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
text
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px; /* Vertically center the text there */
background-color: #0000ff
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
.container {
width: auto;
max-width: 680px;
padding: 0 15px;
}
.text-muted {
color: #fff!important;
}
<!DOCTYPE html>
<!-- saved from url=(0057)https://getbootstrap.com/docs/4.0/examples/sticky-footer/ -->
<html lang="en" class="gr__getbootstrap_com"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="https://getbootstrap.com/favicon.ico">
<title>Sticky Footer Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="assets/css/dashboard.css" rel="stylesheet">
<link href="assets/css/sticky-footer.css" rel="stylesheet">
</head>
<body data-gr-c-s-loaded="true">
<!-- Begin page content -->
<footer class="footer">
<div class="container">
<span class="text-muted">This is a test to check this sticky footer. This footer breaks in small screens.</span>
</div>
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery-3.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="assets/js/popper.js"></script>
<script src="assets/js/bootstrap.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>
</body></html>
【问题讨论】:
标签: twitter-bootstrap bootstrap-4