/    Sign up×
Community /Pin to ProfileBookmark

CSS drop-down killing me

I’ve been trying this trick for the longest time, and can’t for the life of me get it to work! 😑

Here’s my scource, tell me if you find anything wrong.

<html><heaD>
<title>Drop down menu?</title>
<style type=”text/CSS”>
a { text-decoration: none; }
ul.menu, ul.menu, ul {
width: 60px;
border: 2.5px double blue;
background-color: black;
margin-left: 5px;
}
ul.menu li {
list-style-type: none;
margin: 0;
position: relative;
color: red;
}
ul.menu li > ul {
display: none;
position: absolute;
top: 3px;
left: 50px;
}
ul.menu ul.CSStoShow {
display: none;
}
ul.menu li:hover > ul {
display: block;
}
ul.menu li a { color: red; display: block; width: 100% text-decoration: none; }
ul.menu li a:hover, ul.menu li a.CSStoHighLink { color: blue; }
ul.menu li:hover > a {color: blue; }
</style></head><body>
<ul class=”menu”>
<li>Menu</li>
<ul>
<li><a href=”http://Google.com”>Sub</a></li>
<li>Menu</li>
<li>Here</li>
</ul>
</ul></li>

Help me if you can.

to post a comment
CSS

12 Comments(s) ↴

Copy linkTweet thisAlerts:
@LeruraMar 16.2006 β€”Β You have spaces around your childselectors:
[CODE]... ul.menu li:hover [COLOR=Blue]>[/COLOR] ul ...[/CODE]
try removing them so it is:[CODE]... ul.menu li:hover[COLOR=Blue]>[/COLOR]ul ...[/CODE]
Copy linkTweet thisAlerts:
@in1337ened1authorMar 16.2006 β€”Β That didn't work, Thanks for the syntax tip though.
Copy linkTweet thisAlerts:
@ray326Mar 16.2006 β€”Β IE doesn't understand child selectors.
Copy linkTweet thisAlerts:
@CFHuttonMar 16.2006 β€”Β ul.menu, ul.menu, ul {

width: 60px;

border: 2.5px double blue;

background-color: black;

margin-left: 5px;

}[/QUOTE]


Why is there two ul.menu in the first part of this? I'm an idiot, so ignore me at will.

cfh
Copy linkTweet thisAlerts:
@in1337ened1authorMar 16.2006 β€”Β I'm not using IE, I'm using FF
Copy linkTweet thisAlerts:
@in1337ened1authorMar 16.2006 β€”Β Read my signature.
Copy linkTweet thisAlerts:
@ray326Mar 16.2006 β€”Β I agree with CFH. That selector can't be right.
Copy linkTweet thisAlerts:
@in1337ened1authorMar 17.2006 β€”Β Didn't help...
Copy linkTweet thisAlerts:
@ray326Mar 17.2006 β€”Β Ok, this won't fix your problems because I think they are in the design more than the code but here's the corrected list syntax.
[code=html]
<ul class="menu">
<li>Menu</li>
<li>
<ul class="CSStoShow">
<li><a href="http://Google.com">Sub</a></li>
<li>Menu</li>
<li>Here</li>
</ul>
</li>
</ul>
[/code]

Plust IE doesn't understand your child selectors and it doesn't do :hover on anything but anchors so it doesn't understand [B]li:hover>ul[/B] on bit.
Copy linkTweet thisAlerts:
@welshMar 17.2006 β€”Β look, you may be using firefox and firefox is better than ie, but im guessing at least 50% of the web still use's ie.
Copy linkTweet thisAlerts:
@jeff_archer7Mar 17.2006 β€”Β i used a css drop down sucessfully

www.libertychurch.org.au
Copy linkTweet thisAlerts:
@HoboBenMar 18.2006 β€”Β look, you may be using firefox and firefox is better than ie, but im guessing at least 50% of the web still use's ie.[/QUOTE]

It's about 70% IE, 22% firefox, 5% netscape, and then a few others...
Γ—

Success!

Help @in1337ened1 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.17,
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,
)...