html - Hide A Div With CSS Only -
is there way hide div css when click link. i'm making popup needs able close when there no js. i've tried various methods have not worked when button inside div needs hide.
when button inside div needs hide.
short answer: no, can't achieve when button inside element. thanks joseph marikle
however, can achieve when button outside div.
#hide { display: none; } label { cursor: pointer; text-decoration: underline; } #hide:checked ~ #randomdiv { display: none; }
<input type="checkbox" id="hide" /> <div id="randomdiv"> div <label for="hide">hide div</label> </div>
Comments
Post a Comment