5
How do I make for the background-color of h4
be only the width of the text. I can’t delimit a fixed width because I don’t know the size of the text and I can’t use display:inline-block why need the H4 under each other. Does anyone know how I can do this or any other solution to the case will be welcome!
h1{
background-color: yellow;
}
<h1>Testando!</h1>
What I’ve achieved so far is not the expected result:
the headline tags H1, H2, etc occupy the whole line, so the behavior is right. To have a background only in the text you need to use another element, for example by the text in one
label
orspan
– Ricardo Pontual