Semiresponsiva
A página ficou responsiva até determinado dimensionamento, mas depois se desalinhou. Este foi só um experimento, nas próximas aulas vamos aprender como fazer isso direito. :P
GIF do responsivo. https://drive.google.com/file/d/10FFU30h3CBcSBuKIsLiBWf5ue16WwI7w/view?usp=share_link
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.0">
<link rel="stylesheet" href="./src/css/reset.css">
<link rel="stylesheet" href="./src/css/products.css">
<title>Produtos</title>
</head>
<body>
<header>
<div class="caixa">
<h1><img src="./src/images/header-logo-black.png" alt=""></h1>
<nav>
<ul>
<li><a href="./index.html">Home</a></li>
<li><a href="./products.html">Produtos</a></li>
<li><a href="./contacts.html">Contato</a></li>
</ul>
</nav>
</div>
</header>
<main>
<ul class="products">
<li>
<h2>Cabelo</h2>
<img src="./src/images/product-cabelo.jpg" alt=""></img>
<p class="product-description">Na tesoura ou na máquina, como o cliente preferir</p>
<p class="product-price">R$ 25,00</p>
</li>
<li>
<h2>Barba</h2>
<img src="./src/images/product-barba.jpg" alt="">
<p class="product-description">Corte e desenho profissional de barba</p>
<p class="product-price">R$ 18,00</p>
</li>
<li>
<h2>Cabelo + Barba</h2>
<img src="./src/images/product-cabelo+barba.jpg" alt=""></img>
<p class="product-description">Pacote completo de cabelo e barba</p>
<p class="product-price">R$ 35,00</p>
</li>
</ul>
</main>
<footer>
<img src="./src/images/footer-logo-white.png" alt="">
<p class="copyright">
<span class="copyright">©</span> Copyright Barbearia Alura 2022
</p>
</footer>
</body>
</html>
CSS
/*
- = - = = - CABEÇALHO - = - = = -
*/
header {
background: #BBBBBB;
padding: 20px 0;
}
.caixa {
position: relative;
width: 940px;
margin: auto;
}
nav {
position: absolute;
top: 110px;
right: 0;
}
nav li {
display: inline;
margin: 0 0 0 15px;
}
nav a {
text-transform: uppercase;
color: #000000;
font-weight: bold;
font-size: 22px;
text-decoration: none;
}
nav a:hover {
color: #c78c19;
text-decoration: underline;
}
/*
- = - = = - PRODUTOS - = - = = -
*/
.products {
width: 940px;
margin: 0 auto;
padding: 50px 0;
}
.products li {
display: inline-block;
text-align: center;
width: 30%;
vertical-align: top;
margin: 0 1.5%;
padding: 30px 20px;
border: solid 2px #000;
border-radius: 10px;
}
.products li:hover {
border-color: #c78c19;
}
.products li:hover h2 {
font-size: 34px;
}
.products li:active {
border-color: #088c19;
}
.products h2 {
font-size: 30px;
font-weight: bold;
}
.product-description {
font-size: 18px;
}
.product-price {
font-size: 22px;
font-weight: bold;
margin-top: 10px;
}
/*
- = - = = - RODAPÉ - = - = = -
*/
footer {
text-align: center;
background: #CCC;
background-image: url(../images/footer-bg-black.jpg);
padding: 40px 0;
}
.copyright {
color: whitesmoke;
font-size: 13px;
margin-top: 20px;
}
.copyright span {
font-size: 11px;
font-weight: 100;
vertical-align: center;
}
/*
- = - = = - SEMI-RESPONSIVO - = - = = -
*/
@media (max-width: 979px) {
/* HEADER */
header {
background: #BBBBBB;
padding: 0 0 30px 0;
}
header h1 {
text-align: center;
}
nav {
position: absolute;
top: 230px;
right: 300px;
padding-top: 15px;
}
/* MAIN */
.products {
width: 940px;
margin-left: 35%;
padding: 25px 0;
}
.products li {
display: block;
margin-bottom: 20px;
}
}