So I have a navigation bar with no specified width via css so it spans across the whole page, similar to how the gray spans accross the daniweb page, but Im trying to get the actual text/links to be centered. Actually exactly like daniwebs page. spanning bar accross the page but text in the middle, any tips?

Recommended Answers

You can have two divs, the outer with the background color and 100% width and another div inside that one that holds your links and has margin:auto set. margin:auto only works when a length for the parent container is set (I think) otherwise it doesn't know what distance to do …

Jump to Post

All 2 Replies

You can have two divs, the outer with the background color and 100% width and another div inside that one that holds your links and has margin:auto set. margin:auto only works when a length for the parent container is set (I think) otherwise it doesn't know what distance to do the maths on.

Also check

margin 0 auto;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.