I need to create a clickable anchor link that automatically adds the :checked
property to an input when clicked. Is it possible to achieve this using only CSS and without relying on JavaScript? The system I'm working with has limitations that prevent the use of JavaScript.
.toggle:checked+h3+.collapsible-factuur-content {
background-color: pink;
}
<a href="#details">Link to the anchor</a>
<div style="margin-top: 750px;"> </div>
<div id="details">
<mark>The anchor</mark>
</div>
<input class="toggle" id="collapsible-details-historiek" type="checkbox" data-hj-masked="">
<h3>
<label class="gp-product" for="collapsible-details-historiek">
<i class="fas fa-history"></i>
<h4>Title of the item</h4>
</label>
</h3>
<div class="collapsible-factuur-content" id="details-algemeen">
Content of the item.
</div>