index.html
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./styles/reset.css">
<link rel="stylesheet" href="./styles/style.css">
<title>Alura Books</title>
</head>
<body>
<header class="cabecalho">
<div class="container">
<input type="checkbox" id="menu" class="container__botao">
<label for="menu">
<span class="cabecalho__menu-hamburguer container__image"></span>
</label>
<ul class="lista-menu">
<li class="lista-menu__titulo">Categorias</li>
<li class="lista-menu__item"><a href="#">PROGRAMAÇÃO</a></li>
<li class="lista-menu__item"><a href="#">FRONT-END</a></li>
<li class="lista-menu__item"><a href="#">INFRAESTRUTURA</a></li>
<li class="lista-menu__item"><a href="#">BUSINESS</a></li>
<li class="lista-menu__item"><a href="#">DESIGN & UX</a></li>
</ul>
<img src="./assets/Logo.svg" alt="Logo." class="container__image">
</div>
<div class="container">
<img src="./assets/Favoritos.svg" alt="Meus favoritos." class="container__image"></a>
<a href="#"><img src="./assets/Compras.svg" alt="Carrinho de compras." class="container__image"></a>
<a href="#"><img src="./assets/Usuario.svg" alt="Meu perfil." class="container__image"></a>
</div>
</header>
<main></main>
<footer></footer>
</body>
</html>
style.css
@import url("./header.css");
:root{
--cor-background-principal: #EBECEE;
--cor-background-cabecalho: #FFFFFF;
}
body {
background-color: var(--cor-background-principal);
}
.cabecalho {
background-color: var(--cor-background-cabecalho);
display: flex;
justify-content: space-between;
align-items: center;
}
header.css
.cabecalho__menu-hamburguer{
width: 24px;
height: 24px;
background-image: url("../assets/Menu.svg");
background-repeat: no-repeat;
background-position: center;
position: relative;
display: inline-block;
}
.container{
display: flex;
align-items: center;
}
.container__image {
padding: 1em;
}
.lista-menu {
display: none;
position: absolute;
top: 100%;
}
.container__botao:checked~.lista-menu {
display: block;
}
https://cdn1.gnarususercontent.com.br/1/4711471/59a1f65a-c46f-41cc-9292-2c9ac1046a82.jpg
O Menu hamburguer fica ao final da página quando adiciono o top: 100%;