gpt4 book ai didi

html - 当我为移动设备调整页脚大小时,页脚和页面底部之间有一个空白

转载 作者:行者123 更新时间:2023-11-27 23:33:51 25 4
gpt4 key购买 nike

自从我将这些属性添加到我的背景图像后,我的页脚就有这个问题,如果我不添加这些属性,那么页面将在背景图像和页脚之间有一个空白区域,有人可以帮忙吗? :

底部边距:-100px; 填充底部:0;

下面的 CSS 和 HTML 代码:

@import url('https://fonts.googleapis.com/css?family=Gloria+Hallelujah:100,200,300,400,500,600,700|Special+Elite:100,200,300,400,500,600,700');
/*---------------------------------Navigation Bar*/

/*----Navbar Buttons*/
.navbar-nav li a {
color: #ffffff !important;
font-family: "Gloria Hallelujah" , sans-serif;
text-transform: uppercase;
font-size: large;
font-weight: 500;
text-decoration: none;
border:none;
padding: 8px 8px;
margin:4px 2px;
}

nav li a,
nav li a:after,
nav li a:before {
transition: all .5s;
}
#navbar-select-color:hover {
color: #c8c8c8 !important;
}

#logo-transparent {
opacity: 1.0;
filter: alpha(opacity=50);
transition-timing-function: ease-in-out;
transition: all .5s;
}

#logo-transparent:hover {
opacity: 0.8;
filter: alpha(opacity=100);
transition-timing-function: ease-in-out;
transition: all .5s;
}
/*----Navbar Animation*/
nav.stroke ul li a {
position: relative;
}

nav.stroke ul li a:after {
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 0%;
content: '.';
color: transparent;
background: #aaa;
height: 1px;
}
nav.stroke ul li a:hover:after {
width:100%;
}

/*---------------------------------Footer*/
footer {
background: #212529;
color: white;
margin-top:100px;
bottom: 0;
}

footer a {
color: #fff;
font-size: 14px;
transition-duration: 0.2s;
}

footer a:hover {
color: #ced3d7;
text-decoration: none;
}

.copy {
font-size: 12px;
padding: 10px;
border-top: 1px solid #FFFFFF;
}

.footer-middle {
padding-top: 2em;
color: white;
}


/*---------------------------------Social Icons*/

/* footer social icons */

ul {
list-style-type: none;
display: flex;
justify-content: center;

}

ul .social-network {
display: inline;
margin-left: 0 !important;
padding: 0;
float: center;

}

ul .social-network li {
display: inline;
margin: 0 5px;
list-style: none;
}


.social-network a.icoTwitter:hover i {
color: #007bb7;
}
.social-network a.icoFacebook:hover i {
color: #3B5998;
}

.social-network a.icoYoutube:hover i {
color: #c4302b;
}


.social-circle li a {
display: block;
position: relative;
margin: 15px 15px 15px;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
text-align: center;
width: 65px;
height: 65px;
font-size:40px;

}

.social-circle li i {
margin: 0;
line-height: 30px;
text-align: center;
}

.social-circle li a:hover i,
.triggeredHover {
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-ms--transform: rotate(360deg);
transform: rotate(360deg);
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-o-transition: all 0.2s;
-ms-transition: all 0.2s;
transition: all 0.2s;
}

.social-circle i {
color: #595959;
-webkit-transition: all 0.8s;
-moz-transition: all 0.8s;
-o-transition: all 0.8s;
-ms-transition: all 0.8s;
transition: all 0.8s;
}

.social-network a {
background-color: #F9F9F9;
}

/*---------------------------------Background*/

body, html {
height: 100%;
}

img {
width:100%;
height:auto;
position: relative;

}

#bg {

/* Full height */
height: 100%;


/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
width: 100%;
height: 100%;
margin-bottom: -100px;
padding-bottom: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="assets/css/style.css" type="text/css" />
<title>Home|The Monkees</title>
</head>
<body>
<header>
<!--------------------Navigation-->
<nav class="navbar navbar-expand-sm bg-dark navbar-dark stroke">
<a class="navbar-brand" href="index.html">
<img src="assets/image/LOGO.png" id="logo-transparent" alt="logo" style="width:143px;">
</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link " id="navbar-select-color" href="index.html">Home</a>
</li>

<li class="nav-item">
<a class="nav-link" id="navbar-select-color" href="music.html">Music</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color" href="video.html">Video</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color" href="shop.html">Shop</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navbar-select-color" href="contact.html">Contact</a>
</li>
</ul>
</div>
</nav>
</header>
<section>
<div id="bg">
<img src="assets/image/monkees_portrait_402.jpg" alt="">
</div>
</section>

<footer class="mainfooter bg-dark " role="contentinfo">
<div class="footer-middle">
<ul class="social-network social-circle">
<li><a href="https://www.facebook.com/" class="icoFacebook" title="Facebook"><i class="fa fa-facebook"></i></a></li>
<li><a href="https://twitter.com/" class="icoTwitter" title="Twitter"><i class="fa fa-twitter"></i></a></li>
<li><a href="https://www.youtube.com" class="icoYoutube" title="Youtube"><i class="fa fa-youtube"></i></a></li>

</ul>
<div class="col-md-12 copy">
<p class="text-center">&copy; Copyright 2019 - The Monkees. All rights reserved. //<a href="about.html"> About </a> //<a href="privacy_policy.html"> Privacy Policy </a> //<a href="terms_of_use.html"> Terms of Use </a> //<a href="contact.html"> Contact </a></p>

</div>
</div>
</footer>

</body>
</html>

如果能就页脚和导航栏的颜色与图像相比提出一些建议,我们将不胜感激。这是一个元素。

谢谢

最佳答案

由于您没有上传图片我无法正确测试它,如果您希望页脚位于底部,请更改以下内容:

`footer {background: #212529;
color: white;
margin-top:100px;
position: absolute;
/*--Your body does not cover the entire screen´s height therefore the
-20px--*/
bottom: -20px;
}`

我不明白你为什么给它一个 margin-top,但这可能与我们无法访问的其他内容或库有关(bootstrap,图像..),我希望它仍然有帮助 :)

关于html - 当我为移动设备调整页脚大小时,页脚和页面底部之间有一个空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57349899/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com