html - CSS - How to working with multi-level menu by simple -
i have multi-level menu like
i want menu
- has same background (#5b740d see)
- has same active background (red see)
- has same hover background (red see)
and 3 above option menu , sub-menu
but code complex. here example code hover
/* hover: can using simple selector make same background */ .menu li:hover { background: red; } .menu li li ul li a:hover { background: red; } .menu li ul li:hover { background: red; }
i css on internet it's complex change way (but still complex :( plz me make simple ).
but bug: when hover item (2) in picture bellow item (3) hover?
plz simplified css code 3 option above (i don't understand complex code :( ) , me fix bug thank.
here code http://jsfiddle.net/swf6w/
there's no way make more 'simple', there little superfluous markup or definitions in code, don't understand appeal make more simple.
you can fix red hover on child elements specifying direct descendent selector on li:hover a
selector, though. example:
.menu li ul li:hover > { background: red; }
will produce result > http://jsfiddle.net/swf6w/1/
Comments
Post a Comment