-1
I was able to calculate the exact size of the bar and put the value in the padding, but this causes me problems later, how do I make it look like in the image below?
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
font-family: 'Open Sans', sans-serif;
box-sizing: border-box;
}
:root {
--texto-branco: #f2f2f2;
--fundo-preto:#222;
--fundo-azul:#009DFF;
}
nav {
background: var(--fundo-preto);
height: 64px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.logo {
color: var(--texto-branco);
margin: 16px;
cursor: pointer;
}
ul {
list-style: none;
}
li {
padding: 0px 16px;
display: inline-block;
transition: .3s;
}
nav li:hover {
background: var(--fundo-azul);
}
a {
text-decoration: none;
color: var(--texto-branco);
}
</style>
</head>
<body>
<nav>
<div class="logo">VM</div>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Sobre</a></li>
<li><a href="#">Projetos</a></li>
<li><a href="#">Fale Comigo</a></li>
</ul>
</nav>
</body>
</html>
For a simple website which would be the most suitable, calculate the size of the padding or do this way?
– Vinicius Macedo
Calculate padding is gambiarra. It is right to use this way because everything is automatic.
– Sam