Help with menu spacing

Asked

Viewed 735 times

0

Well I’m trying to make a menu where you have, start / over / store and then a space and the "search" and another space and a login/ registration, but I’m not getting. Could someone help me?

<header>
<div class="logobg"><img src="images/logosecure.png"></div> 
<div class="menubarr">
<nav class="menubarr">
<ul>
<a href="#"><li>Inicio</li></a>
<a href="#"><li>Sobre</li></a>
<a href="#"><li>Loja</li></a>
<a href="#"><li>Contato</li></a>
</ul>
</nav>

<nav class="buscar">
<ul>
<a href="#"><li>Buscar</li></a>
</ul>
</nav>

<nav class="log">
<ul>
<a href="#"><li>Cadastrar</li></a>
<a href="#"><li>Login</li></a>
</ul>
</nav>
</div>
</header>

css:

*{margin:0;padding:0;}
header{
    width: 100%;
    height: auto;

}
section{
    width: 100%;
    height: 500px;
    background: #ccc;
}
footer{
    width: 100%;
    height: 50px;
    background: #000;
}
a{
    text-decoration: none;
}

.logobg{
    width: 1280px;
    margin:0 auto;
    background: #fff;
}

.logobg img{
    width: 100px; height: 100px;
}

 .menubarr{
    width: 1280px;
    margin:0 auto;
    background: #000;
}

.menubarr nav ul li{
    background: #000;
    color:#fff;
    display: inline-block;
    padding: 10px 20px;
    border-bottom: 2px solid #000;
}

 .menubarr nav ul li:hover{
    cursor: pointer;
    border-bottom: 2px solid #fff;
}

how are you at the moment :

inserir a descrição da imagem aqui

1 answer

1


Try to do this:

In a div that encompasses all <ul>, define a class name ('menu-block', in this case):

<div class='bloco-menu'>

<nav class="menubarr">
<ul>
<a href="#"><li>Inicio</li></a>
<a href="#"><li>Sobre</li></a>
<a href="#"><li>Loja</li></a>
<a href="#"><li>Contato</li></a>
</ul>
</nav>

<nav class="buscar">
<ul>
<a href="#"><li>Buscar</li></a>
</ul>
</nav>

<nav class="log">
<ul>
<a href="#"><li>Cadastrar</li></a>
<a href="#"><li>Login</li></a>
</ul>
</nav> 

</div>

After that, in CSS, do so:

   .bloco-menu{
    display: flex;
}

li{
    display: inline-flex;

}
ul{
    padding-left: 1px;
}

The display property: inline-block that will make them stand next to each other.

Obs: the padding of <ul> is optional, I put because the <ul>´s has a standard padding-left (left spacing) of approximately 5px, creating a blank space between each ul, if they are side by side.

  • Vlw manooo mt thanks worked, and in case I wanted to give a margin or padding do not know which of the two to use to drive one ul away from the other? Without having to use the float:right.

  • Use 'padding-left' to decrease spacing...

  • opa silva I can edit and ask one more question now doubt is how I can leave a div with a background and within that div have a form that gets Responsive 1280 and centralized?

  • you could help me?

  • Dude, in the CSS properties of this div, try putting: { display: flex; align-items: center; Justify-Contents: center; }

  • 1

    @Gabrielcosta lets me give you a hint. Avoid asking multiple questions within one question. Now that that part of the doubt has been cleared up, it’s okay for you to open another question with the new doubt. Thus you avoid that the author of the answer changes the original answer which is the answer that answers the original question. So if you have another question just open another question, simple like this. It’s just a tip to guide them to use Stackoverflow better ok.

  • @hugocsl opa tranquil.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.