I want to set a CSS background behind any HTML element or tag and it should be a little offset.
Here is the result I'm looking for:
You can see the pointed red arrow to the slight background which is starting before the <h2>
text and ends before the text ends. This background should expand with the amount of text in the element.
I have tried doing this with box shadow which you can see below:
body {
padding: 20px;
}
h2 {
display: inline-block;
box-shadow: -10px 10px 0 red;
}
<h2>Ain't No Mountain</h2>
But as you can see the background is not appearing behind the text.
Let me know if anyone has done this kind of thing :)