I'm basically trying to make a element looking "disabled" by adding an after element with a white opaque filter exactly on top of it.
Problem is, just by setting width and height to 100% it does not include the parent's border!
How can I solve this? I need the after element to sit exactly on top of its parent
div {
border: 5px solid blue;
position: relative;
padding: 1rem;
background-color: blue;
text-align: center;
font-size: 120%;
font-family: sans-serif
}
div::after {
content: "";
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: white;
opacity: 0.6;
z-index: 2;
}
<div>Test</div>