najkiie
03-29-2009, 05:53 PM
Hi.
Today, just a few hours ago, i started working on a new style for my website. I have set it up so that i have one main stylesheet file (for the most important things...) and then i have four other ones (i only load one of them at a time) that contains the colors etc... I also have a stylesheet switcher on the site so that the visitors can change style.
Now to the problem:
As i said above i started working on a new stylesheet file for my site. But i'm kind of stuck on the menu part...
Here's the HTML code for the menu:
<div class="menubar">
<li class="current_page_item">
<a href="http://PlanetTechSupport.com/b">Home</a>
</li>
<li class="page_item page-item-271">
<a href="http://PlanetTechSupport.com/b/?page_id=271" title="Polls">Polls</a>
</li>
<li class="page_item page-item-2">
<a href="http://PlanetTechSupport.com/b/?page_id=2" title="About & Contact">About & Contact</a>
</li>
</div>
As you can see i didn't wrap the <li> tags inside an <ul> or <ol> tag since i don't see the point with it. It will be listed as an Unordered List anyways. I don't think thats the problem.
Here's the CSS.
.menubar {
width: 960px;
margin: 10px auto 0px auto !important;
background: transparent url(http://planettechsupport.com/b/wp-content/themes/premium/images/menubg-4.gif) repeat-x !important;
height: 35px !important;
overflow: hidden;
clear: both;
padding: 0px !important;
}
.menubar li, .menubar li a, .page_item a, .menubar li a:visited {
list-style-type: none !important;
height: 35px;
line-height: 33px !important;
font-size: 14px !important;
font-weight: bold !important;
padding: 0px 5px 0px 5px !important;
margin: 0px !important;
background: transparent url(http://planettechsupport.com/b/wp-content/themes/premium/images/menubg-4.gif) repeat-x !important;
}
.menubar li a:hover, .page_item a:hover, current_page_item a {
background: transparent url(http://planettechsupport.com/b/wp-content/themes/premium/images/menubg-hover-4.gif) repeat-x !important;
color: #FFECE0;
}
As you can see there is no margin involved in the CSS at all (exept for the .menubar, but i need that to center the menu on the page). I used paddings, but that only gives extra space in the inside of the <li> tag right? But if you go to the site and hover over one of the menu items you will see that there is a few pixels of space between the li tags. I have no idea what it comes from. I've been trying to figure it out for about two hours now, its just frustrating!
I've used a firefox addon called Firebug to figure out where the <li> tags loads the CSS from, and i can't find any margins in there either.
Am i doing something wrong? I did try to add a <ul> tag before but that didn't solve anything (i also set the margin and padding for the ul tag to 0px).
It looks the same in IE (IE 8).
If you'd like to check it out yourself here is the link to my site:
http://planettechsupport.com/b/?switchstyle=4
That link will bring you to the site, and also set the style to the one i'm working on.
And BTW, i'm using Wordpress. (thats the reason why i have those wicked classes for the <li> items in the menu)
If you have any idea on what i'm doing wrong, then please, help me?
-Nike
Today, just a few hours ago, i started working on a new style for my website. I have set it up so that i have one main stylesheet file (for the most important things...) and then i have four other ones (i only load one of them at a time) that contains the colors etc... I also have a stylesheet switcher on the site so that the visitors can change style.
Now to the problem:
As i said above i started working on a new stylesheet file for my site. But i'm kind of stuck on the menu part...
Here's the HTML code for the menu:
<div class="menubar">
<li class="current_page_item">
<a href="http://PlanetTechSupport.com/b">Home</a>
</li>
<li class="page_item page-item-271">
<a href="http://PlanetTechSupport.com/b/?page_id=271" title="Polls">Polls</a>
</li>
<li class="page_item page-item-2">
<a href="http://PlanetTechSupport.com/b/?page_id=2" title="About & Contact">About & Contact</a>
</li>
</div>
As you can see i didn't wrap the <li> tags inside an <ul> or <ol> tag since i don't see the point with it. It will be listed as an Unordered List anyways. I don't think thats the problem.
Here's the CSS.
.menubar {
width: 960px;
margin: 10px auto 0px auto !important;
background: transparent url(http://planettechsupport.com/b/wp-content/themes/premium/images/menubg-4.gif) repeat-x !important;
height: 35px !important;
overflow: hidden;
clear: both;
padding: 0px !important;
}
.menubar li, .menubar li a, .page_item a, .menubar li a:visited {
list-style-type: none !important;
height: 35px;
line-height: 33px !important;
font-size: 14px !important;
font-weight: bold !important;
padding: 0px 5px 0px 5px !important;
margin: 0px !important;
background: transparent url(http://planettechsupport.com/b/wp-content/themes/premium/images/menubg-4.gif) repeat-x !important;
}
.menubar li a:hover, .page_item a:hover, current_page_item a {
background: transparent url(http://planettechsupport.com/b/wp-content/themes/premium/images/menubg-hover-4.gif) repeat-x !important;
color: #FFECE0;
}
As you can see there is no margin involved in the CSS at all (exept for the .menubar, but i need that to center the menu on the page). I used paddings, but that only gives extra space in the inside of the <li> tag right? But if you go to the site and hover over one of the menu items you will see that there is a few pixels of space between the li tags. I have no idea what it comes from. I've been trying to figure it out for about two hours now, its just frustrating!
I've used a firefox addon called Firebug to figure out where the <li> tags loads the CSS from, and i can't find any margins in there either.
Am i doing something wrong? I did try to add a <ul> tag before but that didn't solve anything (i also set the margin and padding for the ul tag to 0px).
It looks the same in IE (IE 8).
If you'd like to check it out yourself here is the link to my site:
http://planettechsupport.com/b/?switchstyle=4
That link will bring you to the site, and also set the style to the one i'm working on.
And BTW, i'm using Wordpress. (thats the reason why i have those wicked classes for the <li> items in the menu)
If you have any idea on what i'm doing wrong, then please, help me?
-Nike