Is there a way to create a title like this: https://i.sstatic.net/iSw34.png
I've experimented with various options on https://jsfiddle.net/hx4m9kfa/, but using display: inline-block;
is not working, nor is display: block
or anything involving width: 100%
.
h1, h2, h3 {
background-color: orange;
margin: 0 0 10px 0;
font-size: 2em;
}
h2 {
display: inline-block;
background-color: green;
}
h3 {
background-color: purple;
}
<h1>
Lorem ipsum dolor sit amet, conset etur sadipscing elitr, sed diam nonumy eirmod
</h1>
<h2>
Lorem ipsum dolor sit amet, conset
</h2>
<h2>
etur sadipscing elitr, sed diam nonumy eirmod
</h2>
<h2>
nonumy eirmod
</h2>
<h3>
Lorem ipsum dolor sit amet, conset
</h3>
<h3>
etur sadipscing elitr, sed diam nonumy eirmod
</h3>
<h3>
nonumy eirmod
</h3>
Is it possible to have the entire title enclosed in just one tag (without needing JavaScript)? Any solution that achieves the desired result would be greatly appreciated. Can anyone offer guidance on how to achieve this? Thank you!