Centralization of ul in a strange way

0

I have a very strange problem.

css

.lista {
	margin:0 auto;
}

ul.listaTopo, ul.listaRegistros {
	margin:0 auto;
	padding:0;
	width:100%;
}

ul.listaTopo {
	background-color:#000;
	color:#FFF;
}

ul.listaTopo li, ul.listaRegistros li {
    display:inline-block;
	height:50px;
	line-height:50px;
	vertical-align:middle;
	text-align:center;
	font-weight:bold;
}
<div class="lista" style="width:900px">
  <ul class="listaTopo">
    <li style="width:100px">TIPO 
    <li style="width:400px">NOME 
    <li style="width:100px">LOGIN 
    <li style="width:100px">BLOQUEIO 
    <li style="width:100px">EDITAR 
    <li style="width:100px">EXCLUIR 
  </ul>
  <ul class="listaRegistros">
    <li style="text-align:left; width:100px; background-color:#CCC; color:#FFF">Super
    <li style="text-align:left; width:400px; background-color:#CCC; color:#FFF">Carlos Rocha
    <li style="text-align:center; width:100px; background-color:#CCC; color:#FFF">caca
    <li style="text-align:center; width:100px; background-color:#CCC; color:#FFF"><a href="" onclick="return verifica('Deseja Bloquear este Administrador?')" '=""><img src="_img/bloquear.png" height="30px" title="Bloquear Administrador"></a>
    <li style="text-align:center; width:100px; background-color:#CCC; color:#FFF"><a href="administradoresEditar.php?acao=form&amp;idAdmin=1"><img src="_img/editar.png" height="30px" title="Editar Administrador"></a>
    <li style="text-align:center; width:100px; background-color:#CCC; color:#FFF"><a href="" onclick="return verifica('Deseja Excluir este Administrador?')" '=""><img src="_img/excluir.png" height="30px" title="Excluir Administrador"></a>
  </ul>
</div>

I have the div. list and I'm setting the margin as 0 auto in css but it is not working.

But if I do:

 $(".lista").css('margin', '0 auto');

With JQuery it works.

Where am I going wrong?

    
asked by anonymous 05.05.2016 / 20:52

2 answers

0

Maybe, try putting a display block on the div: ul.listaTopo, ul.listaRegistros

margin-left: auto; margin-right: auto;

    
05.05.2016 / 21:24
0

I'm sorry people. Maybe the solution can help someone in the future.

I made a php style comment

////////////////////////// INICIO LISTAGENS //////////////////
////////////////////////// FIM LISTAGENS /////////////////////

But you have to have the wildcard

/*                           INICIO LISTAGENS                 */
/*                            FIM LISTAGENS                   */
    
05.05.2016 / 21:25