So I have a div that appears/disappears on clicking checkbox.
<input type="checkbox" id="btn">
<div id="box"></div>
#box {
display: none;
width: 100px;
height: 100px;
}
#btn:checked + #box
display: block;
}
But I also want to add an option to close it by clicking anywhere outside this box. How can I do it?
Aucun commentaire:
Enregistrer un commentaire