So yesterday I decided to create a hand cricket game, but guess I messed up with its interface! I had set up a main tag in it whose height wasn’t written yet, after adding the background to it, I got that I forgot to set height of the main tag. This is the code
main.html
<!DOCTYPE html>
<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">
<title>HTML</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav>
Hand Cricket
</nav>
<main>
<div class="play-bot">
Play with a bot!
</div>
<div class="play-friend">
Play with a friend!
</div>
<div class="set-a-scenario">
Set a custom scenario!
</div>
<div class="matches-log">
Matches log
</div>
</main>
<script src="main.js"></script>
</body>
</html>
style.css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
nav{
height: 10vh;
width: 100%;
background: #3E3E3E;
display: flex;
justify-content: center;
align-items: center;
font-size: 33px;
color: white;
}
main{
padding: 5%;
background: #3E3E3E;
}
.play-bot, .play-friend, .set-a-scenario, .matches-log{
width: 99%;
margin-top: 3px;
height: 100px;
border: none;
display: flex;
justify-content: center;
align-items: center;
font-size: 30px;
background: #9933CC;
color: #F5F5F5;
}
Later i added the height in main
as 100%
Still, when I ruined the code, the page looked the same
What can I do?