- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 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.
Hi Guys, I am new to this site and I am stuck on trying to centre my CSS navigation bar and centre the text, like the navigation bar I created on this website here: http://wrapsandtints.co.nr
Here is my current website and navigation bar that needs updating to look like the one above:
http://wrapsandtints.eu.pn/
Thanks very much for your help.
JtB
@JtB Are you content with using tables to structure your code?
Yes, the navigation bar is placed inside a table.
The best option is to use inline block instead of tables (the worst option) or floats.
http://joshnh.com/2012/02/07/why-you-should-use-inline-block-when-positioning-elements/
Here’s an example with a sub level included : http://codepen.io/Paulie-D/pen/86731daa8998d3df818160b9df55d6d9
Thanks Paulie, is there no line of code I can use to just centre the CSS Navi bar I already have in the table?
Thanks
Nevermind, solved it now. Thanks for your help guys!
Nope…not really.
You could give the `ul` width..say the same as the table (938) which will extend the menu and it will, therefore be centered but that won’t center the list items.
Other than that you could set a left margin on the ul (say 69 px [938 -800]/2) but that would be rally hacky and not ideal