html - 如何修复 Chrome 中的浮动页脚?
问题描述
我网站的页脚在 Chrome 中“浮动”,向下滚动时会留下一个空白:
这在 Firefox 或 Edge 中不会发生。检查 CSS 和 HTML 结构,未发现任何异常 - 下面提供了相关部分。有什么补救措施吗?
html {margin: 0; height: 100%}
body {margin: 0; height: 100%}
* {box-sizing: border-box;}
body {font-family: Arial; margin: 0;}
.footdiv6{
background: rgba(145,145,173,1);
background: -moz-linear-gradient(top, rgba(145,145,173,1) 0%, rgba(80,80,131,0.8) 10%, rgba(67,67,122,0.81) 12%, rgba(44,44,130,0.88) 25%, rgba(43,43,132,0.92) 32%, rgba(42,42,135,0.95) 39%, rgba(40,40,138,0.96) 49%, rgba(1,1,36,1) 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(145,145,173,1)), color-stop(10%, rgba(80,80,131,0.8)), color-stop(12%, rgba(67,67,122,0.81)), color-stop(25%, rgba(44,44,130,0.88)), color-stop(32%, rgba(43,43,132,0.92)), color-stop(39%, rgba(42,42,135,0.95)), color-stop(49%, rgba(40,40,138,0.96)), color-stop(100%, rgba(1,1,36,1)));
background: -webkit-linear-gradient(top, rgba(145,145,173,1) 0%, rgba(80,80,131,0.8) 10%, rgba(67,67,122,0.81) 12%, rgba(44,44,130,0.88) 25%, rgba(43,43,132,0.92) 32%, rgba(42,42,135,0.95) 39%, rgba(40,40,138,0.96) 49%, rgba(1,1,36,1) 100%);
background: -o-linear-gradient(top, rgba(145,145,173,1) 0%, rgba(80,80,131,0.8) 10%, rgba(67,67,122,0.81) 12%, rgba(44,44,130,0.88) 25%, rgba(43,43,132,0.92) 32%, rgba(42,42,135,0.95) 39%, rgba(40,40,138,0.96) 49%, rgba(1,1,36,1) 100%);
background: -ms-linear-gradient(top, rgba(145,145,173,1) 0%, rgba(80,80,131,0.8) 10%, rgba(67,67,122,0.81) 12%, rgba(44,44,130,0.88) 25%, rgba(43,43,132,0.92) 32%, rgba(42,42,135,0.95) 39%, rgba(40,40,138,0.96) 49%, rgba(1,1,36,1) 100%);
background: linear-gradient(to bottom, rgba(145,145,173,1) 0%, rgba(80,80,131,0.8) 10%, rgba(67,67,122,0.81) 12%, rgba(44,44,130,0.88) 25%, rgba(43,43,132,0.92) 32%, rgba(42,42,135,0.95) 39%, rgba(40,40,138,0.96) 49%, rgba(1,1,36,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9191ad', endColorstr='#010124', GradientType=0 );
}
.htp04{height:40px} .wi10{width:100%} .fs09{font-size:90%}
.wlink /* white color, hover-only underline */
<html>
<head><!-- meta, link, title, script code--></head>
<!-- div code -->
<body>
<!-- div, a, img, li code-->
<!-- script code (JS); nothing fancy, just buttons-->
</body>
</html>
<!-- header & footer implemented via PHP, e.g.
<?php include("PHP/header.php"); ?> -->
<!-- complete footer code -->
<div style="transform:translateY(10px); margin-top:-10px" class="footdiv6 htp04 wi10">
<div class="fs09" style="margin-left:50px; margin-top:12px; color:white; float:left; font-weight:700">
Dragon Notes, Est. 2018     <a href="About.php" class="wlink">About</a></div>
<h4 class="fs09" style="margin-right:50px; margin-top:12px; margin-bottom: 0; color:white; float:right;">By OverLordGoldDragon</h4></div>
解决方案
页脚中的<h4>
元素插入了一个边距底部(仅在 Chrome 中有效) - 一旦设置为零,间隙就会被骑乘。
推荐阅读
- laravel - laravel snappy pdf:收到错误文件未创建
- .net - 在 IIS 中绑定 IP 后,应用程序未在虚拟机中加载
- python - 如何在Python中以字符串作为输入参数获取浮点值?
- php - Cookie 未在 http 注册(在 php 中)
- domain-driven-design - 使用持久函数,如何从活动函数返回多个值
- powershell - 无法在 powershell 窗口上打印输出,该输出将用于进一步读取主机输入
- c - C在使用openssl aes-128-cbc模式解密消息时返回不可读的字符串
- vba - 将边框应用于 InlineShape 应用于它所在的表而不是图像
- gradle - Gradle:如何将一些 groovy 代码翻译成 kotlin
- jenkins - 仅为一组阶段设置 Jenkins 流水线超时