mcmwhfy
mcmwhfy

Reputation: 1686

Custom dropdown select with css and html

I'm trying to create a custom drop-down menu with html and css only. I'm wondering if is possible to work with focus instead of hover? now is on hover and works but I want to expand that select onclick.

Here I have a fiddle example: http://jsfiddle.net/RwtHn/1084/

Upvotes: 1

Views: 1921

Answers (2)

Abraham
Abraham

Reputation: 20686

EDIT: Here's a demo: http://jsfiddle.net/RwtHn/1087/
Wow. I'm surprised this is even possible with just HTML/CSS.

Upvotes: 2

Ana
Ana

Reputation: 37169

Don't use hover on the li, use hover on the a:

a:hover + ul, a:focus + ul, a:active + ul {}

DEMO

Upvotes: 5

Related Questions