Image of website 嘿!当我将高度设置为100%时,什么都不会出现,这只会随着其中的对象(文本,图片,iframe等)缩放。尝试了多种方法,似乎没有任何效果。我可能只是愚蠢。 下面是代码,html代码和Style.css代码。 奖励:奥拉夫(Olav)
h2{
text-shadow: 4px 2px #606060;
font-size: 100px
}
body {
margin: 0;
font-size: 28px;
font-family: Arial, Helvetica, sans-serif;
}
.header {
background-image:url('Bilder/background_01.jpg');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
padding: 10px 0px;
text-align: center;
width: 80%;
margin: auto;
}
#navbar {
overflow: hidden;
background-color: #333;
width: 80%;
margin: auto;
float:center;
}
#navbar a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 20px 0;
width: 33.33%;
text-decoration: none;
font-size: 35px;
}
#navbar a:hover {
background-color: #ddd;
color: black;
}
#navbar a.active {
background-color: #4CAF50;
color: white;
}
.content {
height: 100%;
background: white;
padding: 25px 0px;
margin: auto;
width:80%;
z-index: 10;
}
.sticky {
top: 0;
right: 0;
left: 0;
position: fixed;
}
.sticky + .content {
padding-top: 60px;
}
@media screen and (max-width: 700px) {
#navbar a {
float: none;
display: block;
width: 100%;
text-align: left;
}
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="Style.css">
</head>
<body style="background:#101010;min-height:100%">
<div class="header">
<h2>FELLE</h2>
</div>
<div id="navbar">
<a class="active" href="#">Hjem</a>
<a href="#">Historie</a>
<a href="#">Hyttefelt</a>
</div>
<div style="content">
</div>
</body>
</html>
<div class="content">
</div>
</body>
</html>