Buenas! ¿como puedo hacer para que mi contenedor principal tenga la altura necesaria para cubrir mis elementos? Por ejemplo, quiero que el contenedor solo llegue a la linea roja, para que no abarque tanto espacio innecesario, ya trate poniéndole un ~heigth:15vw;~ pero también tengo que cambiar el heigth de el otro contenedor ¿No hay otra manera? siento que esta manera esta mal, mucho código y no siento que sea adecuado. Muchas gracias
html {
box-sizing: border-box;
font-size: 62.5%;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
font-size: 1.6rem;
line-height: 2;
background-image: url("../img/35.jpg");
background-repeat: no-repeat;
background-size: cover;
}
.contenedor {
width: 95%;
margin: 0 auto;
}
img {
max-width: 100%;
}
.centrar-texto {
text-align: center;
}
.logo {
height: 30rem;
width: 30rem;
}
.contenedor-nav {
display: grid;
grid-template-columns: 30% 70%;
/* width: 100%;
height: 10%; */
}
.elemento {
text-decoration: none;
color: #ffffff;
font-family: 'montserrat';
font-size: 2.5rem;
flex-grow: 1;
}
.navegacion-principal {
/* min-width: 80vw; */
display: flex;
text-align: center;
padding-top: 3rem;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/normalize.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700|Public+Sans:400,700&display=swap" rel="stylesheet">
<title>Raspados Isla</title>
</head>
<body>
<div class="contenedor-nav">
<div class="logo">
<a href="index.html">
<img src="/img/logoo copia.png" alt="Logo Raspados Isla">
</a>
</div>
<nav class="navegacion-principal">
<a href="#" class="elemento">Raspados</a>
<a href="#" class="elemento">Tejuino</a>
<a href="#" class="elemento">Tepache</a>
<a href="#" class="elemento">Tuba</a>
<a href="#" class="elemento">Cerveza De Raíz</a>
</nav>
</div>
<h1 class="centrar-texto">¿Mucho calor?</h1>
</body>
</html>
[![introducir la descripción de la imagen aquí][2]][2]