CSS transitions with the "checked" hack -
this question has answer here:
- is there “previous sibling” css selector? 12 answers
i'm trying similar example using "checked" hack
input[type=checkbox]:checked ~ label .box { opacity:0; -webkit-transform :scale(0) rotate(-180deg); -moz-transform :scale(0) rotate(-180deg); transform :scale(0) rotate(-180deg); } http://codepen.io/anon/pen/kvwwjy
however, need change html code label tag before input tag. when move input in bottom effects stop working. how can fix this?
there no previous sibling selector in css. if there was, css lot slower. there has been lot of debate on subject , won't happen in foreseeable future.
as chowey put it:
css selectors designed easy (fast) implement browser. document can traversed once, matching elements go, no need ever go backward adjust match
simply put, you'll have change markup. can't make css backwards. looks forward.
for more info on subject, see this question.
Comments
Post a Comment