I want the background color to wrap exactly around inline characters.
I can’t explain it better, so here is an image showing exactly what I want:

HTML
<div>
<span>HTML Text block - HTML Text block</span>
</div>
CSS
div {
max-width: 300px;
line-height: 1.5;
text-transform: uppercase;
}
span {
background-color: white;
box-shadow: 5px 5px 0 black;
padding: 0;
}
If this cannot be done with CSS alone, can JavaScript help?
Here codepen
source
share