/    Sign up×
Community /Pin to ProfileBookmark

background-color; color for submenus for drop down menu

I can’t get my submenus to have the background-color:#099FF; and the text to be color:#ffffff; for the drop down menus in the hover stage. I must have over looked something, but I’m not seeing it. I would apprecipate any suggestions.

#nav, #nav ul {
display:block;
float:left;
width:50em; /* was 50em*/
height:100%;
list-style:none;
/*background-color:#000000;*/
color:#003399;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px; /* was small */
font-weight:bold;
/*text-align:center;*/
/*vertical-align:middle;*/
padding:0;
border-style:solid;
border-color:#003399;
border-width:1px;
margin-left:0px;
background-color:#ffffff;
z-index:5;
}

#nav a {
/*width:20em;*/
width:6em; /* wsa 6, 9em */
color:#003399;
text-decoration:none;
padding:0.25em 2em;
height:100%;
display:block;
text-align:center;
background-color:#cccccc;
/*color:#003399;*/
}
/*
#nav a.daddy {
background: url(../rightarrow2.gif) center right no-repeat;
}
*
/

#nav li {
float:left;
padding: 0;
/*width:10em;*/
width:10em; /*was 10, 9 */
text-align:center;
height:100%;
display:block; /* I added */
list-style:none;
}

#nav li ul {
position:absolute;
left:-999em;
height:auto;
/*width: 14.4em;*/
/*width:13.9em;*/
width:10em; /*10 , 9*/
font-weight:normal;
border-style:solid;
border-width:1px; /* changed from 0.10em*/
margin: 0;
/*margin-top:1px; I added this */
display:block;
text-align:center;
list-style:none; /* I added this */
background-color:#cccccc; /* I added this */
color:#ffffff; /* I added this */
}

#nav li li {
/*padding-right: 1em; /* I commented it out */
/*
width: 13em*/
width:6em; /*
6 10 em*/
color:#ffffff;
background-color:#cccccc;
}

#nav li ul a {
/*width: 13em;
width: 9em;*
/
width:6em; /* 6, 5em*/
}

#nav li ul ul {
/*margin: -1.75em 0 0 14em;*/
margin:1px;
}

#nav li:hover ul ul, #nav li.sfhover ul ul {
left:-999em;
/*left:-999em; */
/*left:-60px; /* I changed */
/*
addded below 061906 */
background-color:#0099FF;
color:#ffffff; /*
I added this */
display:block; /*
I added this */
width:10em; /*
10, 9, I added this */
}

#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
left: auto;
background-color:#0099FF;
color:#ffffff; /*I added this */
}

#nav li:hover, #nav li.sfhover {
background-color:#0099FF;
color:#ffffff; /* I added this */
display:block; /* I added this */
width:10em; /* 10, 9 , I added this */
}

List for the menu:

<ul id=”nav”>

<li>
About Us
<ul>
<li><a href=”#”>History</a></li>
<li><a href=”#”>Capabilities</a></li>
</ul>
</li>

<li>Traction Power
<ul>
<li><a href=”#”>IMProCon&#8482;</a></li>
<li><a href=”#”>Battery Substation</a></li>
<li><a href=”#”>Switchgear</a></li>
<li><a href=”#”>Rectifier</a></li>
<li><a href=”#”>Relays</a></li>
<li><a href=”#”>TPS Projects</a></li>
<li><a href=”#”>TPS Brochures</a></li>
</ul>
</li>

<li>Catenary
<ul>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>OCS Catalog</a></li>
<li><a href=”#”>OCS Projects</a></li>
<li><a href=”#”>OCS Brochure</a></li>
</ul>
</li>

<li>EMC Traction
<ul>
<li><a href=”#”>About EMC</a></li>
<li><a href=”#”>Circuit Breakers</a></li>
<li><a href=”#”>Website</a></li>
</ul>
</li>

<li>Services
<ul>
<li><a href=”#”>CS Advocate</a></li>
<li><a href=”#”>Sales Reps.</a></li>
<li><a href=”#”>Training</a></li>
</ul>
</li>

</ul>
</div>

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJun 28.2006 — Unless I am mistaken, "hover" only works for anchors. At leaset that is what happens in IE, up to IE 6.
Copy linkTweet thisAlerts:
@toicontienJun 28.2006 — You need to specify the style of the links in its various states:
<i>
</i>#nav a {}

#nav a:link {}

#nav a:visited{}

#nav a:hover {}

#nav a:focus {}

#nav a:active {}

Same thing for after a.daddy

<i>
</i>#nav a.daddy {}

#nav a.daddy:link {}

#nav a.daddy:visited{}

#nav a.daddy:hover {}

#nav a.daddy:focus {}

#nav a.daddy:active {}
Copy linkTweet thisAlerts:
@P099Jun 28.2006 — im sure this might help


[CODE]#csstopmenu li{
float: left;
position: relative;
text-align:center;
width:128px;
height:20px;
border:0px;
}

a.menu {
display: block;
height:20px;
width:128px;
text-decoration: none;
}

a.menu:link,
a.menu:visited {
color: white;
background-color:black;
}

a.menu:hover {
color: black;
background-image: url(../imgppl/over.jpg);
font-style:oblique;
} [/CODE]
[/QUOTE]


it is in a question just after this one, but it has tour answer on it.

and then you do this

&lt;li&gt;&lt;a class="menu" href="whatever you want"&gt;History&lt;/a&gt;&lt;/li&gt;

just keep yours height equal ?

but you would need a javascript code, if you want it tell me
Copy linkTweet thisAlerts:
@impulseauthorJun 28.2006 — Sure, I will definite need the javascript code.

Thanks!
×

Success!

Help @impulse spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...