I'm interested in adding a black block after the red one with some text, similar to the example shown in the first screenshot.
Despite my attempts, I couldn't get it to work. As a newcomer to CSS, I'm facing some challenges...
h2 {
width: fit-content;
background-color: #FF0000;
}
h2:after {
display: block;
width: 50px;
background-color: #000000;
}
Any suggestions on how I can achieve this effect?