I'm trying to create an image box with various graphic elements on it. For this I have the following HTML code:
.image-description:after {
content: '';
position: absolute;
background: #333333;
opacity: 0.6;
}
.image-box:after {
content: '';
position: absolute;
background: linear-gradient(135deg, rgba(0, 0, 0, 0) 50%, rgba(232, 193, 30, 1) 50%);
opacity: 0.85;
}
<div class="container">
<div class="image-box" style="background-image: ... "></div>
<div class="image-description">
<h3>xxx</h3>
<p>xxx</p>
</div>
</div>
What I want is to display the elements in the following order:
- image-box
- image-description:after
- image-box:after
- image-description
So I want to display the linear gradient created in .image-box:after in front of the image-description. Is there a way to put the after of image-box between image-description and image-description:after?