Hey guys,
I have a (hopefully quick) question regarding to coding a drop-down menu using CSS.
If you click HERE you will see what I am attempting to achieve...
I am having issues creating the actual navigation bar (with the brown background) for some reason. I have never coded a drop-down menu with CSS (always used Flash in the past but am trying to learn this way). What I want to do is the following:
1) Have three links on the navigation bar (Products, Services, Information) each with their own drop down menu.
2) The drop down menu needs to be transparent so that the image below is visible.
3) The drop down menu needs to have a brown border
4) The drop down menu needs to have a rollover for the hover states of the links
In addition to this navigation bar, I have moved all the links to text based versions in the header to account for browsers without support for hover states and transparency, so as not to impede user's navigation options.
Things I don't care about that you might see in the screenshot:
1) I don't care about the drop shadow (it would be nice to have, so please tell me if you know a SIMPLE way to do it)
2) I don't care about the little arrows pointing downwards next to first level navigation
3) I don't care about the vertical seperators in the screenshot between the first-level navigation items...they aren't really necessary.
Here is my thought (but I can't get it to work):
CSS:
That's what I tried...and it's kind of close. What I need exactly is the first item (Products) needs to be 20px from the left side of the div, and each item in the top-level list need to be about 10px apart. Each of those need a drop-down with transparency and border. After that I think I can figure it out on my own...I did get the transparency to work by using a 5x5 transparent .png image for the background...
Perhaps anyone has an idea? I think I am going about it with a bad skeleton or idea or something...
THANK YOU SO MUCH IN ADVANCE!!!
I have a (hopefully quick) question regarding to coding a drop-down menu using CSS.
If you click HERE you will see what I am attempting to achieve...
I am having issues creating the actual navigation bar (with the brown background) for some reason. I have never coded a drop-down menu with CSS (always used Flash in the past but am trying to learn this way). What I want to do is the following:
1) Have three links on the navigation bar (Products, Services, Information) each with their own drop down menu.
2) The drop down menu needs to be transparent so that the image below is visible.
3) The drop down menu needs to have a brown border
4) The drop down menu needs to have a rollover for the hover states of the links
In addition to this navigation bar, I have moved all the links to text based versions in the header to account for browsers without support for hover states and transparency, so as not to impede user's navigation options.
Things I don't care about that you might see in the screenshot:
1) I don't care about the drop shadow (it would be nice to have, so please tell me if you know a SIMPLE way to do it)
2) I don't care about the little arrows pointing downwards next to first level navigation
3) I don't care about the vertical seperators in the screenshot between the first-level navigation items...they aren't really necessary.
Here is my thought (but I can't get it to work):
HTML:
<div id="navigation">
<ul id="navbar">
<li><a href="#">Products</a>
<ul>
<li><a href="#">Product Overview</a></li>
<li><a href="#">Cloth Diapers</a></li>
<li><a href="#">Accessories</a></li>
</ul>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Services Overview</a></li>
<li><a href="#">Clothing Design</a></li>
<li><a href="#">Consulting</a></li>
</ul>
<li><a href="#">Information</a>
<ul>
<li><a href="#">Community</a></li>
<li><a href="#">Why Cloth?</a></li>
<li><a href="#">How-To's</a></li>
</ul>
</ul>
</div>
CSS:
Code:
#navbar
{
margin-top: 0px;
padding-top: 8px;
}
#navbar li
{
list-style: none;
float: left;
}
#navbar li a
{
display: block;
padding-bottom: 7px;
color: #ffffff;
text-decoration: none;
}
#navbar li ul
{
display: none;
width: 150px; /* Width to help Opera out */
background: url("../images/trans_brown.png");
font-size: 11px;
}
#navbar li:hover ul
{
display: block;
position: absolute;
margin: 0px;
padding-top: 0px;
padding-left: 0px;
}
#navbar li:hover li
{
float: none;
padding-top: 2px;
padding-bottom: 0px;
border-bottom: 1px solid brown;
border-right: 1px solid brown;
border-left: 1px solid brown;
}
#navbar li:hover li a
{
padding-left: 2px;
color: #ffffff;
}
#navbar li li a:hover
{
background: url("../images/trans_brown.png");
}
That's what I tried...and it's kind of close. What I need exactly is the first item (Products) needs to be 20px from the left side of the div, and each item in the top-level list need to be about 10px apart. Each of those need a drop-down with transparency and border. After that I think I can figure it out on my own...I did get the transparency to work by using a 5x5 transparent .png image for the background...
Perhaps anyone has an idea? I think I am going about it with a bad skeleton or idea or something...
THANK YOU SO MUCH IN ADVANCE!!!