The content is showing up differently for me than it should. I've attempted to use line breaks (br tags) and compare the code, but it looks identical to the tutorial I am following. I'm puzzled as to why it's displaying differently when we are working on the same project. I even recreated the project to ensure I didn't miss anything. There are two columns, but the first column is displaying everything vertically. Even after adding more text, it continues to adjust vertically. Everything works as expected until I add padding: 0 19%; 0 to the top and bottom and 19% to the sides, at which point the display changes. I am using Microsoft Edge.
The HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<!-- boxicons link-->
<link rel="stylesheet"
href="https://unpkg.com/boxicons@latest/css/boxicons.min.css">
<!-- remixicon link-->
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="057760686c7d6c666a6b45362b312b35">[email protected]</a>/fonts/remixicon.css" rel="stylesheet">
<!-- google fonts-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Permanent+Marker&family=Poppins:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
</head>
<body>
<header>
<a href="#" class="logo">COC-STATS</a>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Clans</a></li>
<li><a href="#">Town hall</a></li>
<li><a href="#">Troops</a></li>
<li><a href="#">Contacts</a></li>
</ul>
<div class="bx bx-menu" id="menu-icon"></div>
</header>
<section class="hero">
<div class="hero-text">
<h5>#2 Trending</h5>
<h4>Lead Supercell</h4>
<h1>GOBLINS</h1>
<p>Join millions of players worldwide as you build your village, <br> raise a clan, and compete in epic Clan Wars!! </p>
<a href="#">Compare</a>
<a href="#" class="ctaa"><i class="ri-play-fill"></i>Watch Gameplay!</a>
</div>
<div class="hero-img">
<img src="img-removebg.png" alt="">
</div>
</section>
<script src="script.js"></script>
</body>
</html>
The CSS:
*{
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
list-style: none;
box-sizing: border-box;
text-decoration: none;
}
header{
position: fixed;
right:0;
top:0;
z-index: 1;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 33px 9%;
background: transparent;
}
.logo{
font-size: 30px;
font-weight: 700;
color: #fff;
}
header ul{
display: flex;
}
header ul li a{
color: #fff;
margin-left: 60px;
font-size: 15px;
font-weight: 600;
border-bottom: 2px solid transparent;
transition: all .55s ease;
}
header ul li a:hover{
border-bottom: 2px solid white;
}
#menu-icon{
color: #fff;
font-size: 35px;
z-index: 2;
cursor: pointer;
display: none;
}
.hero{
height: 100%;
width: 100%;
min-height: 100vh;
background: linear-gradient(245.59deg, #4d9559 0%, #38703d 28.53%, #133917 75.52%);
position: relative;
display: grid;
grid-template-columns: repeat(2,1fr);
align-items: center;
gap: 2rem;
}
section{
padding: 0 19%;
}