Check out my HTML:
.imageURL:active .image_submit_div {
background-color: #ccc;
}
.image_submit_div:active {
background-color: #e6e6e6;
}
<div class="image_div">
<label for="id_image" class="image_submit_div">
<h3>+ add file</h3>
<input id="id_imageURL" class="imageURL" type="text" name="imageURL" />
</label>
<input id="id_image" type="file" name="image" />
</div>
The main div is image_submit_div
. It changes color when clicked.
The nested element is .imageURL
. I don't want the parent div's color to change when this is clicked. The code above doesn't work for that purpose.
How can I stop the parent div from changing color when the child div is clicked?
UPDATE: For more clarity, here is a link to a code snippet: https://codepen.io/kingdezz/pen/WOoPgY