Hello, I have a problem. I’ve just coded a responsive navbar and added divs with onclick function with CSS not JS. I want the text place right under the navbar but not behind it and I can’t manage it. Here’s the code:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style3.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
* {
margin: 0;
padding: 0;
}
html {
scroll-behavior: smooth;
}
.navbar {
width: 100%;
height: 100px;
background-color: #00aeef;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}
ul {
list-style-type: none;
font-size: 25px;
font-family: "Montserrat", sans-serif;
}
li {
float: right;
line-height: 100px;
margin-right: 25px;
transition: 0.1s ease-out;
}
a {
text-decoration: none;
color: white;
}
li:hover {
font-size: 33px;
}
.first {
list-style-type: none;
font-size: 30px;
color: white;
display: none;
}
#click {
display: none;
}
#container {
width: 100%;
height: 100vh;
text-align: center;
}
#container div {
width: 100%;
height: 100%;
}
@media (max-width: 700px) {
.navbar {
background-color: #00aeef;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
position: fixed;
}
ul {
position: fixed;
top: 100px;
height: 100vh;
width: 100%;
background-color: #00d2ff;
left: 0;
transition: 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955)
}
li {
position: relative;
float: none;
display: flex;
justify-content: center;
top: 15%;
line-height: 80px;
transition: 0.2s ease-out;
}
#click {
cursor: pointer;
}
.first {
display: block;
left: 90%;
top: 10%;
cursor: pointer;
}
#click:checked ~ ul {
left: 100%;
}
}
</style>
</head>
<body>
<div class="navbar">
<input type="checkbox" id="click">
<label for="click">
<li class="first"><i class="fa fa-bars"></i></li>
</label>
<ul>
<li><a href="#Statistics">Statistics</a></li>
<li><a href="#Import">Import</a></li>
<li><a href="#Planes">Planes</a></li>
<li><a href="#About">About</a></li>
<li><a href="#Home">Home</a></li>
</ul>
</div>
<div id="container">
<div id="Home"><h1>Home</h1></div>
<div id="About"><h1>About</h1></div>
<div id="Planes"><h1>Planes</h1></div>
<div id="Import"><h1>Import</h1></div>
<div id="Statistics"><h1>Statistics</h1></div>
</div>
</body>
</html>