View Full Version : Nav Bar isnt aligning properly to other elements that are

06-11-2012, 08:25 PM
I am using CSS and HTML on a site I am creating for a friend. You can see it here: http://krystlekleen.batcave.net/testpages

This is what my style sheet looks like, and it has done everything correctly except for centering that nav bar over top of the logo image.

body { background:#CCFFFF url(bkgdimg2.png) repeat-y;
background-position:center; }

#foreground {
text-align: center; }

and here is my html code:

<link type="text/css" rel="stylesheet" href="stylet.css">
<style type="text/css">
a:hover,a:active{background-color:#6600CC;} </style>
<div id="foreground">
<ul><li><a href="#catalogue">Catalogue</a></li><li><a href="#contact">Contact Me</a></li></ul>
<img src="logo.png">

I'm not understanding what is going wrong, I used this same method on this page:http://krystlekleen.batcave.net for the nav bar and it works great. Any help is greatly appreciated. Thank you for reading

06-11-2012, 08:31 PM
I dont know if this is the fix you want but this will align your navigation center.

#foreground {
text-align: center;

change too

#foreground {
text-align: center;
margin:0 auto;

06-12-2012, 08:15 PM
Thanks for the help, I did change the css code and that did left align the nav bars with the logo. So then I went into my html code and changed the width of the buttons to 415px, and that evened it out nicely. I appreciate the help :thumbsup: