I have a problem with my CSS gradient background... When I only had the <body>
, the gradient background looked perfect on it, but now that I have added new HTML elements with CSS code, it looks like repeated:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Topiks Quizz</title>
</head>
<body>
<header>
<h1>Topiks Quizz</h1>
<nav>
<ul>
<li>Inicio</li>
</ul>
<ul>
<li>CategorÃas</li>
</ul>
</nav>
</header>
<section id="container">
<article>
<div class="card">
<img src="./assets/img_avatar.png" alt="Avatar" style="width:100%">
<div class="container">
<h4><b>John Doe</b></h4>
<p>Architect & Engineer</p>
</div>
</div>
</article>
</section>
</body>
</html>
@font-face {
font-family: NotoSans;
src: url(./assets/fonts/NotoSans-Regular.ttf);
}
* {
font-family: NotoSans;
margin: 0;
padding: 0;
}
body {
background: rgb(174,238,187);
background: linear-gradient(22deg, rgba(174,238,187,1) 0%, rgba(162,222,236,1) 47%, rgba(148,233,212,1) 100%);
}
header {
background-color: rgba(255, 255, 255, 30%);
width: 100%;
height: 50px;
}
header h1 {
float: left;
}
header nav ul {
list-style: none;
float: right;
padding: 10px;
}
.card {
margin: 30px 30px;
background-color: white;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
width: 200px;
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
.container {
padding: 2px 16px;
}