Icon over the image?

There is the following code:
<div class="post-104 post type-post status-publish category-black">

<a href="...">
<img src="https://site.com/wp-content/cache/thumbnails/thumb.jpg">
</a>

</div>


If a class has a category-black, then should be displayed above the main picture icon (icon.png). Please tell me how to implement it with css?
June 10th 19 at 14:59
1 answer
June 10th 19 at 15:01
Solution
A pseudo-class
.category-black:after{}
Does not work. That is where to register? - Mary.Effert commented on June 10th 19 at 15:04
, Something like this
.category-black{
 position: relative;
}
.category-black:after{
 content: ";
 position: absolute;
 top: 0;
 left: 0;
 z-index: 5;
 background-image: url('img/icon.png');
 background-repeat: no-repeat;
 width: 100px;
 height: 100px;
}
- Grady commented on June 10th 19 at 15:07
Thank you very much! Did it! - Mary.Effert commented on June 10th 19 at 15:10

Find more questions by tags CSS