The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Centering
I’m pretty new for web designing, And I wanna know, How to position Navigation Bar which created using un-orderd list and image replacement, to center (with every screen resolutions)? Thanks! :)
If you want to center something you can use margin:auto.
I made an example for you: http://www.cssdesk.com/LM8Aw
This requires a width however. With navigation if you want to center it there will be issues in the future if you try to add more links.
Hope that helped!
You could use the
or easily make it like this (the recommended way):
HTML
One Two Three Four
CSS
#nav{ margin: 0 auto; text-alignment: center; } #nav ul, li{ display:inline; } #nav ul{ list-style-type: none; }
@SmashDeveloper
Why even mention the
tag? It’s obsolete and is not even part of the HTML5 spec