-1
I have the html below and your css.
No matter how hard I try, I’m not being able to centralize the ul list in the div. This ul brings data from a search to the database. Where I am missing?
*
{
width:100%;
}
.body
{
width: 100%;;
margin: 0 auto;
}
ul {
list-style-type:none;
padding:0;
}
////////////////////////// INICIO LISTAGENS ////////////////
div.divLista, div.divListaItens {
width:100%;
text-align:center;
}
ul.listaTopo, ul.listaRegistros {
clear:both;
width:95%;
}
ul li.listaTopoLi {
float:left;
background-color:#000;
color:#fff;
height:50px;
line-height:50px;
vertical-align:middle;
text-align:center;
font-weight:bold;
margin: 0 auto;
padding:0;
}
////////////////////////// FIM LISTAGENS //////////////////
<div class="divListaItens">
<ul class="listaRegistros">
<li class='listaTopoLi' style='text-align:left; width:100px; background-color:#CCC; color:#FFF'>Super</li>
<li class='listaTopoLi' style='text-align:left; width:400px; background-color:#CCC; color:#FFF'>Carlos Alberto Rocha</li>
<li class='listaTopoLi' style='text-align:center; width:100px; background-color:#CCC; color:#FFF'>caca</li>
<li class='listaTopoLi' 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>
<li class='listaTopoLi' style='text-align:center; width:100px; background-color:#CCC; color:#FFF'><a href='administradoresEditar.php?acao=form&idAdmin=1'><img src='_img/editar.png' height='30px' title='Editar Administrador' /></a></li>
<li class='listaTopoLi' 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></li>
</ul>
<ul class='listaRegistros'>
<li class='listaTopoLi' style='text-align:left; width:100px; background-color:#FFF; color:#CCC'>Comum</li>
<li class='listaTopoLi' style='text-align:left; width:400px; background-color:#FFF; color:#CCC'>José Mário</li>
<li class='listaTopoLi' style='text-align:center; width:100px; background-color:#FFF; color:#CCC'>jose</li>
<li class='listaTopoLi' style='text-align:center; width:100px; background-color:#FFF; color:#CCC'><a href='' onclick="return verifica('Deseja Bloquear este Administrador?')" '><img src='_img/bloquear.png' height=30px title='Bloquear Administrador' /></a></li>
<li class='listaTopoLi' style='text-align:center; width:100px; background-color:#FFF; color:#CCC'><a href='administradoresEditar.php?acao=form&idAdmin=2'><img src='_img/editar.png' height='30px' title='Editar Administrador' /></a></li>
<li class='listaTopoLi' style='text-align:center; width:100px; background-color:#FFF; color:#CCC'><a href='' onclick="return verifica('Deseja Excluir este Administrador?')" '><img src='_img/excluir.png' height='30px' title='Excluir Administrador'/></a></li>
</ul>
</div>
But what I am wanting to center is the whole ul within a div that has width: 100%. So I must not be understanding your answer!
– Carlos Rocha
Yes. Dreamweaver Usage. This is the output the browser released from a php foreach. I picked it up by displaying source code (Ctr+U). I just copied this part of the code and made a separate html file and gave the same error!
– Carlos Rocha