Wednesday, 11 September 2013

Trying to absolute center ul (vertical and horizontal) in nav

Trying to absolute center ul (vertical and horizontal) in nav

... with the help of this tutorial at > coding.smashingmagazine.com/..
nav {
color: #fff;
background-color: #333;
position: relative;
height: 200px;
}
nav ul {
list-style: none;
overflow: auto;
width: 50%;
height: 50%;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
nav li {
display: inline-block;
margin: 0 10px;
font-size: 25px;
line-height: 100%;
}
I can't get it right. Look at my jsfiddle.
Thanks for any help.
An image ... chrome/macos x 10.8.x > is the ul v/h centered?

No comments:

Post a Comment