1
I’m having trouble creating a responsive menu/navigation below the code Html5 and css3.
As it should be:
Could you tell me where the mistake is, please.
- HTML5:
<nav>
<a href="#"> TURISMO DIGITAL </a>
<ul>
<li> <a href="#sobre"> Sobre </a> </li>
<li> <a href="#servicos"> Serviços </a> </li>
<li> <a href="#portfolio"> Portfólio </a> </li>
<li> <a href="#contato"> Contato </a> </li>
</ul>
</nav>
- CSS3
nav{
display: flex;
flex-direction: column;
align-items: center;
background-color: #4d4d4d;
}
nav > a {
/* O filhos diretos de 'a' será estilizado, os demais não. */
text-decoration: none;
color: #f1f1f1;
font-size: 28px;
font-weight: bold;
font-family: 'Facifico', 'serif';
}
nav ul{
padding: 0;
margin: 0;
flex-direction: column;
align-items: center;
width: 100%;
}
nav ul li{
text-align: center;
width: 100%;
padding: 1%;
}
nav ul li a{
display: inline-block;
padding: 10px 0;
width: 100%;
text-decoration: none;
color: #f1f1f1;
}
nav ul :hover {
background-color: #a4a4a4;
}
@media screen and (min-width: 768px) {
nav{
flex-direction: row;
justify-content: space-around;
}
nav ul{
flex-direction: row;
width: 70px;
}
}
Hi, do you make use of any front-end framework? Bootstrap, Foundation..... for example...
– ElvisP