I have a rather colorful background, and to make the text legible, it’s set on a semi-transparent background. H1, P both show the background the full width of the divs. spans and as however only show the background for where they are. This latter behavior is what I would prefer, definitely for the Headings, but also possibly for the paragraphs as well.
|-------------width of div-----------|
|{Header:BG fills whole div_________}|
| {LINK} |
|{Paragraph:Same behavior as header_}|
| {SPAN} |
|------------------------------------|
I’m using CSS strict HTML for preference.
The difference between
<h1>,<p>,<span>and<a>is that the first two are"display:block"by default, while last two are"display:inline".Adding
"display:block"property to your<a>and<span>should do it.Response to comment:
I’ll add a visual examle:
returns this
while
returns this
You are trying to achieve that, right?