- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I tried everything but I can’t get this to work… How can I center my .navigation div in my #header div?
Please help!
The code on CodePen: http://codepen.io/Jochim/pen/dsolb
See how the following goes for you.
I think there is no need for styling with relative and absolute positioning until the
Then centering the ul horizontally in the div.navigation will be as follows: div.navigation ul{margin: 0 auto;}
It would be a lot easier not to use floats on the list items / links but use inline-block. All you would have to do then is put text-align:center on the ul.
Here’s a basic one where I was just tinkering with JS…you can ignore that part.
http://codepen.io/Paulie-D/pen/8f4c32507c84075b9b1d1ad61d2c9cc6
The reason I used floats is because it allows for dynamic `
that’s true of justify, but not center