example
my block
I would like to add black block after red one with text, similiar like on the example (first screenshot)
I was trying to do it like that, but it doesn’t work. I’m new to CSS… :/
h2 {
width: fit-content;
background-color:#FF0000;
}
h2:after {
display: block;
width: 50px;
background-color:#000000;
}
How can I achive something like this?
New contributor
Damian ProExCurator Dbrowski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.