我希望将图像放置在背景图像的中间,但是由于导航栏已固定,因此我不能将其向下移动。当我将其向下移动时,导航栏随之出现。我如何向下移动图像?因为现在看起来图像是导航栏的遗迹。
html, body {
margin: 0;
padding: 0;
width: 100%;
}
body {
font-family: 'Josefin Sans', sans-serif;
}
header {
width: 100%;
height: 100vh;
background: url(/assets/image/startsida.jpg) no-repeat 50% 50%;
background-size: cover;
}
.content {
width: 94%;
margin: 4em auto;
font-size: 20px;
line-height: 30px;
text-align: justify;
}
.logo {
line-height: 60px;
position: fixed;
float: left;
margin: 16px 46px;
color: #fff;
font-weight: bold;
font-size: 20px;
letter-spacing: 2px;
}
nav {
position: fixed;
width: 100%;
line-height: 60px;
}
nav ul {
line-height: 60px;
list-style: none;
background: rgba(0, 0, 0, 0);
overflow: hidden;
color: #fff;
padding: 0;
text-align: right;
margin: 0;
padding-right: 40px;
transition: 1s;
}
nav.black ul {
background: #fff;
}
nav ul li {
display: inline-block;
padding: 16px 40px;;
}
nav ul li a {
font-family: 'Josefin Sans', sans-serif;
font-size: 14px;
color: #000;
font-weight: 600;
text-transform: uppercase;
text-decoration: none;
}
.menu-icon {
line-height: 60px;
width: 100%;
background: #000;
text-align: right;
box-sizing: border-box;
padding: 15px 24px;
cursor: pointer;
color: #fff;
display: none;
}
.logo-type img {
display: block;
margin-left: auto;
margin-right: auto;
}
@media(max-width: 786px) {
.logo {
position: fixed;
top: 0;
margin-top: 16px;
}
nav ul {
max-height: 0px;
background: #000;
}
nav.black ul {
background: #000;
}
.showing {
max-height: 34em;
}
nav ul li {
box-sizing: border-box;
width: 100%;
padding: 24px;
text-align: center;
}
.menu-icon {
display: block;
}
}
<header>
<nav>
<div class="menu-icon">
<i class="fa fa-bars fa-2x"></i>
</div>
<div class="logo">
<img src="/TeknikSnabben/assets/image/logo.png">
</div>
<div class="menu">
<ul>
<li><a href="#">START</a></li>
<li><a href="#">TJĂ„NSTER</a></li>
<li><a href="#">OM OSS</a></li>
<li><a href="#">KONTAKT</a></li>
</ul>
</div>
</nav>
<div class="logo-type">
<img src="/assets/image/logo2.png">
</div>
</header>