gpt4 book ai didi

html - 如何摆脱标题、视口(viewport)顶部和第一张图片之间的空白?

转载 作者:行者123 更新时间:2023-11-28 14:44:43 24 4
gpt4 key购买 nike

<分区>

我正在尝试为我的学校元素模仿某种视差效果。只有一件小事我似乎无法解决,那就是间距。

标题上方和图片正上方无缘无故有空白。我知道将标题和主体分开会给你这条白线,但我想知道如何摆脱 both 空白 enter image description here

body {
height: 100%;
margin: 0;
}

header {
background-color: rgb(0, 0, 51);
width: 100%;
z-index: 999;
height: 100hv;
}

.navigatie {
list-style: none;
text-align: center;
}

li {
display: inline-block;
font-size: 1.5em;
margin-right: 3.5em;
font-family: 'Oswald', sans-serif;
}

a {
text-decoration: none;
color: rgb(255, 255, 255);
}

a:hover {
color: rgb(204, 0, 0);
}

.foto1,
foto2,
foto3 {
position: relative;
opacity: 0.70;
background-position: center;
background-size: cover;
}

.foto1 {
background-image: url("images/ik.png");
height: 100vh;
width: 100%;
}

.foto2 {
background-image: url("images/ik.png");
min-height 100%;
}

.foto3 {
background-image: url("images/ik.png");
min-height 100%;
}
<!DOCTYPE html>
<html>

<head>

<meta charset="UTF-8">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<title> - </title>

</head>

<body>
<!--navigatie-->
<header>
<nav>
<ul class="navigatie">
<li> <a href="index.html"> home</a></li>
<li> <a href="about.html"> about me</a></li>
<li> <a href="contact.html"> contact</a></li>
<li> <a href="artikel.html"> artikels</a></li>
</ul>
</nav>
</header>


<main>

<!--foto 1 + text-->
<div class="foto1">
<div class="fototext1">

</div>
</div>

<!--kolomtext-->

<section class="sectie content1">
<h1> Welkom op mijn website!</h1>
</section>

<!--foto 2 + text-->

<div class="foto2">
<div class="fototext2">

</div>
</div>

<!--kolomtext-->

<section class="sectie content2">
<h1> Gewoon dingen!</h1>
</section>

<!--foto 3 + text-->

<div class="foto3">
<div class="fototext3">

</div>
</div>

<!--kolomtext-->

<section class="sectie content3">
<h1> mooi toch?!</h1>
</section>



</main>



</body>

</html>

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