My Code:
HTML:
<input id="show" type=checkbox>
<div id="content">
<p>i need help</p>
<label for="show" style="color: red;">Hide</label>
</div>
<label for="show" >read more</label>
CSS:
#show,#content{display:none;}
#show:checked~#content{display:block;}
This code will show/hide the Content when clicked on "read more" But I also want to hide the "read more" when its clicked using only css without javascript.
How can I hide it? Thanks in advance!!
#show,#content{display:none;}
#show:checked~#content{display:block;}
<input id="show" type=checkbox>
<div id="content">
<p>Any help would be appreciated</p>
<label for="show" style="color: red;">Hide</label>
</div>
<label for="show" >read more</label>
label, as it did for#content- only that you want to setdisplay:none.