Quote:
Originally Posted by hobnail
I vaguely recall banging my head against this a long time ago and never found a solution.
|
If you want the coloured box to match content width you can add a span with padding/colours. Something like this:
Code:
<h1 class="heading"><span class="decor">CHAPTER 1</span></h1>
<h1 class="heading"><span class="decor">Chapter One Hundred and Fifty-Two</span></h1>
Code:
.heading {
font-family: sans-serif;
font-size: 1.1em;
margin: 3em 0;
text-align: center;
text-indent:0;}
.decor {
background: teal;
color: white;
padding: 0.5em 1em;
}