我想将about部分置于FIXED头部和页脚之上? 我很努力如何解决这个问题,我试图添加填充到顶部,但我注意到它只是移动的内容不是整个div.Also位置相对不能解决问题,因为页脚不在约节下对答案的解释将有助于正确理解答案。如何将标题下的标题放在页脚的顶部?
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
margin: 0;
padding: 0;
line-height: 50px
}
header {
background-color: #191919;
position: fixed;
width: 100%;
color: #edf9ff;
min-height: 70px;
border-bottom: #0fe216 3px solid;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
margin-top:0;
}
header a {
text-decoration: none;
text-transform: uppercase;
color: #edf9ff;
}
a:hover {
color:blue;
}
header ul {
margin: 0;
}
header li {
list-style-type: none;
float: left;
padding-right: 20px;
}
#showtime {
position:relative;
top:100px;
width:80%;
margin: 0 auto;
background-color: #f2f2f2;
}
#showtime img {
width:300px;
height:300px;
}
/*Image Repz*/
.showright {
clear:both;
}
.highlight {
font-size:125%;
color:blue;
}
.showright img {
float:right;
clear:both;
}
.boxes:first-child {
padding-top:50px;
}
.boxes:not(:first-child) {
padding-top:100px;
}
.showright > p, .showright > h2 {
text-align: center;
}
.showleft img {
float:left;
clear:both;
}
.showleft > p, .showleft > h2 {
text-align: center;
}
footer {
margin-top:30px;
background-color:#191919;
height: 100px;
display: flex;
align-items: center;
justify-content: center;
clear:both;
}
footer p{
text-align: center;
color: white;
}
<!DOCTYPE html>
<html>
<head>
<title>Photography | Home </title>
<link href="About.css" rel="stylesheet"/>
<script type="application/javascript" src="Home.js"></script>
</head>
<body>
<header>
<div id="branding">
<h2>PHOTOGRAPHY</h2>
</div>
<nav id="links">
<ul>
<li><a href="Home.html">Home</a></li>
<li><a href="About.html">About</a></li>
<li><a href="#">PHOTO GALLERY</a></li>
<li><a href="#">VIDEO GALLERY</a></li>
</ul>
</nav>
</header>
<section id="showtime">
<div class="showleft boxes">
<h2>What are we about?</h2>
<p>In Mukhtar Photography, we specialise in creating a perfect video with the highest quality and we always tend to keep our promise. Whether it is an
Video or not we are <span class="highlight">MASTERS</span> at delivering the best photos
</p>
</div>
<div class="showleft boxes">
<h2>Why should you ask Mukhtar Photography for like: Marriages, videos?</h2>
<p>Because we put our dedication towards and is very unlikely to be any cancels to the project and if there is you will be paid 90% of the money you gave us.
</p>
</div>
</section>
<footer>
<p>Note that any copyright © is reserved</p>
</footer>
</body>
</html>
Z索引被用于元件下的顺序。我认为 –