Imagine you have a clickable container that leads to another page when clicked. However, there are elements within this container that you want to disable so that clicking on them does not activate the link. How can this be achieved?
For instance, in this scenario, I aim to deactivate the red portion of the container.
a {
text-decoration: none;
color: white;
}
.container {
display: flex;
width: 400px;
height: 100px;
background-color: #ddd;
box-sizing: border-box;
padding: 5px;
}
.block-1 {
width: 50%;
height: 100%;
background-color: #3e3e3e;
text-align: center;
box-sizing: border-box;
padding-top: 20px;
}
.block-2 {
width: 50%;
height: 100%;
background-color: red;
text-align: center;
box-sizing: border-box;
padding-top: 20px;
}
<a href="#">
<div class="container">
<div class="block-1">Active</div>
<div class="block-2">Disabled</div>
</div>
</a>