Hide/show second level

They have: 173 posts

Joined: Feb 2005

If I have this format:

<ul>
    <li><a href="/">Index</a>
        <ul>
            <li><a href="/">Index sublink</a></li>
        </ul>
    </li>
</ul>
'

How can I make the inner ul show or hide when hovering on the parent, without javascript...?

SonicMailer Pro - Professional mailing list manager & award-winning email marketing software
Download a FREE 30-day trial today!
Use coupon savemoreon4 and save 10%!

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Triexa.com;207529 wrote: If I have this format:
How can I make the inner ul show or hide when hovering on the parent, without javascript...?

You can't avoid scripting, as far as I'm aware. Certainly you shouldn't be able to, as neither XHTML nor CSS have any semantically sensible means of achieving this. Scripting is supposed to handle it.

Why are you averse to JS? Smiling

(You could use Flash -- that's scripting too.)

They have: 173 posts

Joined: Feb 2005

Well, what I COULD do is...

li:hover, which works in I think just about evberything except IE seeing as how ie only likes a:hover

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Triexa.com;207536 wrote: Well, what I COULD do is...

li:hover, which works in I think just about evberything except IE seeing as how ie only likes a:hover

Yes, I thought there might be some :hover trickery that could conceivably do it. However, I could not figure out how you'd modify the style of an element from the :hover pseudoclass belonging to another. Did you get this to work?

Even if it is possible, I wouldn't think it sensible. While it would be appropriate to describe the visible and invisible styles of the child

    using CSS, it is the scripting language's business to trigger the switch from an event in the parent.

You haven't said why you want to avoid scripting. Smiling

nicora's picture

He has: 267 posts

Joined: Nov 2001

I doubt you will ever get it working without any script, it's not what CSS is meant to do.

Take a look at son of suckerfish
http://www.htmldog.com/articles/suckerfish/dropdowns/example/bones2.html

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.