0
I can’t centralize a list in the center of the div. I was able to leave more or less centralized defining a width for ul, but it is not aligned with the corners.
* {
margin: 0px;
padding: 0px;
}
body {
font-size: 1em;
}
#conteiner {
width: 960px;
margin: 0 auto;
background: red;
}
#nav ul {
list-style: none;
margin: auto;
text-align: center;
}
#nav li {
float: left;
}
.clear {
clear: both;
}
<!DOCTYPE html>
<html lang="pt-br" dir="ltr">
<head>
<meta charset="utf-8">
<title>test</title>
<link rel="stylesheet" href="_estilos/estilo.css">
</head>
<body>
<div id="conteiner">
<div id="nav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>
<div class="clear"></div>
</div>
</body>
</html>
Centered horizontally, or vertically ? Here it’s perfectly aligned horizontally... you want to align the text within the element?
– hugocsl
@hugocsl I want to center ul in the middle of the div, the li are in the right position, I just want t get td in the middle of the screen
– Jv_werneck