What are we facing?
I want to devote a section of my page to quotations from external sources, and I want to do it the right way, both visually and semantically.
The Solution
You should use the <blockquote> tag because it’s meant to designate quoted text, generally long quotations. An use of <blockquote> is exemplified below
<blockquote><span>
The <blockquote> tag is supposed to contain only block-level elements within it,
and not just plain text. To validate the page as strict XHTML,
you must add a block-level element around the text within the <blockquote> tag
</span></blockquote>
If you use <blockquote> as shown above, you’ll notice that the only thing that happens when you apply it is that your paragraph gets indented as you can see below
The <blockquote> tag is supposed to contain only block-level elements within it, and not just plain text. To validate the page as strict XHTML, you must add a block-level element around the text within the <blockquote> tag
By the way, you should not use <blockquote> for indentation purposes.
Now you need your quotation to look nice. In order to change the rendering of you quotation we are going to apply some CSS magic to the <blockquote> tag
blockquote
{
padding: 5px;
font-style: italic;
background-color:Silver
}
And this is how the quote looks like when the style is applied
The <blockquote> tag is supposed to contain only block-level elements within it, and not just plain text. To validate the page as strict XHTML, you must add a block-level element around the text within the <blockquote> tag
Now you have semantically correct quotations rendered nicely.
Some external references
[advertisement] Try
Aggiorno for free, the assistant tool for web development you always wanted.