![]() |
Center CSS Buttons in Within a Class
Hi,
I have made a bunch of buttons each inside there own class (i.e #home, #other). All of the buttons are inside a class called nav. My question is how do I center the buttons without messing up nav or the rest of my site. Thanks! |
Here's an example for you millsi80 - http://nopeople.com/CSS/menu-h_centered-ul/index.html
View the source to see how it's done. |
Thanks for your response.
I added the text-align:center in the #nav class and I got the image below. It is not quite centered, but getting there :) http://i39.tinypic.com/4j8ft4.jpg |
hi millsi80,
Have you tried adding: Code:
margin:0 auto;All the best - redspyder |
I tried that and I am still getting the unbalance.
|
Can you paste the code here ?
All the best - redspyder |
Sure
Code:
<style type="text/css"> |
http://www.cssplay.co.uk/menus/centered.html
Uses a UL/LI configuration instead of simple anchors like navbar, but it works. |
Hello millsi80,
That's an interesting approach... I've never done it that way. I took nav and centered that, have to give it a width to do it - the total width of all your buttons. Make the background color come from #banner then, by moving it's closing tag down to include the #nav. Change the margins on #banner h1 so the white background is back... I didn't have the images so there are some background colors in there. Just copy/paste this whole bit into a new .html document to see it - Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
Thanks everyone!
|
| All times are GMT +1. The time now is 04:39 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.