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">


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
A pseudo-class
Does not work. That is where to register? - Mary.Effert commented on June 10th 19 at 15:04
, Something like this
 position: relative;
 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