0
Hello.
I have the menu below:
<ul class="menuUlTopo">
<li class="menuTopo"><a href="principal.php" title="Principal">Principal</a></li>
<li class="menuTopo"><a href="administradoresMenu.php" title="Administradores">Administradores</a></li>
<li class="menuTopo"><a href="clientesMenu.php" title="Clientes">Clientes</a></li>
<li class="menuTopo"><a href="imoveisMenu.php" title="Imóveis">Imóveis</a></li>
<li class="menuTopo"><a href="tiposMenu.php" title="Tipos de Imóveis">Tipos de Imóveis</a></li>
<li class="menuTopo"><a href="emails.php?acao=listar" title="E-mails">E-mails</a></li>
</ul>
I’d like to make it fluid. But as much as I can change the css I can’t make the menu items fall below each other when we decrease the screen size.
Where am I going wrong?
Here is the css
a, a:hover {
text-decoration:none;
color:#FFF;
}
ul {
list-style-type:none;
padding:0;
}
ul.menuUlTopo {
width: 100%;
}
ul li.menuTopo {
float:left;
width:161px;
height:50px;
text-align:center;
border-left: #005E9C 1px solid;
border-right: #005E9C 1px solid;
}
ul li.menuTopo a {
width:161px;
height:50px;
display:table-cell;
vertical-align:middle;
color: #FFF;
}
ul li.menuTopo:hover {
background-color: #CCC;
color: #FFF;
}
Grateful to those who can help
Another problem is that the li’s are descending following the fluid layout but the links to and to:Hover remain in their positions not following the li’s. What to do?
– Carlos Rocha
You can put it the way you are doing on http://jsfiddle.net please?
– LF Ziron
Okay. This one: https://jsfiddle.net/hnzajwwq/
– Carlos Rocha
O :Hover needs to be set to element 'a', not in li. And 'background-color' should be set in 'a', since you have set fixed height in ul. I corrected and updated: https://jsfiddle.net/hnzajwwq/2/
– LF Ziron
ok ndeu right. Now tell me one thing: to center the li’s vertically it is even necessary to use display:table-cel?
– Carlos Rocha
Another thing: li’s and links' boxes are not adjusting to the size of the screen. They’re just descending. That’s the way it is?
– Carlos Rocha
Well, you can put them as percentage and set a constant min-width, depends on your layout
– LF Ziron
I don’t understand! You can explain it better by doing me a favor?
– Carlos Rocha
For example: https://jsfiddle.net/hnzajwwq/4/
– LF Ziron
Ok. But in this example the texts are not vertically aligned: mddle.
– Carlos Rocha
For this we can use line-height. Thus: https://jsfiddle.net/hnzajwwq/5/
– LF Ziron