html - Selecting a div before a "checkmark:checked" condition in CSS -



html - Selecting a div before a "checkmark:checked" condition in CSS -

okay, i'm making responsive navigation out of pure css (using tutorial). way works is, when you're viewing responsive (condensed) menu, "menu" button has hidden checkbox input assigned it. when checkbox checked, navigation ul#menu (set display:none; in mobile view) gets set display:block so:

input[type=checkbox]:checked ~ #menu {display:block;}

i have span arrow icon menu items submenus rotates point downwards when hover on li submenu.

<li class="dropdown"><a href="#">link submenu</a><span class="arrow">></span></li> .dropdown:hover .nav-arrow {transform:rotate(90deg);}

standard stuff.

i didn't "hover" attribute displaying submenu in mobile view, converted checkboxes well. tapping li items trigger own checkboxes display submenu ul beneath them.

input[type=checkbox]#show-menu:checked ~ .sub-nav {display:block;}

the problem can't seem figure out how submenu arrows rotate downwards when tap(check) submenu link.

i've tried moving input both above , below li arrow (using both checkbox:checked + .nav-arrow , checkbox:checked ~ .nav-arrow respectively), nil seems work.

does have ideas of how appropriately select span arrow after checkbox checked? appreciate it!

as quick side note, i'm not javascript/jquery savvy, , point of avoid using it, solutions negating languages preferred. :)

edit: here's js fiddle of exact html/cs setup: http://jsfiddle.net/nl3cd9mg/

thanks responses far, hope fiddle helps. :p

ah! got it. simple solution overlooked, always. became more specific selectors:

input[type=checkbox]#show-cl-menu:checked ~ .show-cl-menu .nav-arrow {

instead of old

input[type=checkbox]#show-cl-menu:checked ~ .nav-arrow {

thanks input!

html css checkbox css-selectors

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -