Recent Article
Six Ways to Style Blockquotes
Posted on July 15, 2008. By Rob Glazebrook.
The blockquote XHTML tag is a fairly useful (if somewhat underused) element. Semantically speaking, a blockquote should be used any time you’re quoting a longer piece of text from another source – another speaker, another website, whatever. It’s a way of setting the text apart, and showing that it came from some other source. Stylistically, you could accomplish all this with a special class on your paragraph tags… but that wouldn’t be as semantically useful, now, would it?
Blockquotes do have some styling by default. Most browsers will indent the text in a blockquote tag, which helps the user recognize that the text is different somehow. But who’s to say that we need to stop there? Here are six different ways you could style your blockquotes using CSS.
Color and Borders
Applying a color change to the text and adding a border (along with some additional margins and padding) can really make the blockquote stand out, yet is subtle enough to retain a hint of sophistication.
blockquote {
margin: 1em 3em;
color: #999;
border-left: 2px solid #999;
padding-left: 1em; }
Background Colors
If you’d like something a little more obvious than just a text color change, you might considering altering your background color instead. This causes the blockquote to “pop,” making it immediately more noticeable. When applying background colors, be sure to account for any tags inside that might alter your margins (such as paragraph tags).
blockquote {
margin: 1em 3em;
padding: .5em;
background-color: #f6ebc1; }
blockquote p {
margin: 0; }
Background Colors and Borders
Of course, we’re not just limited to either-or, here. A background color in addition to a border in a complementary color is a nice effect, particularly on sites that are a little bit more “glossy.”
blockquote {
margin: 1em 3em;
padding: .5em 1em;
border-left: 5px solid #fce27c;
background-color: #f6ebc1; }
blockquote p {
margin: 0; }
Background Images
We’re also not just limited to colors! Many websites make use of background images in their blockquotes to help distinguish them from the surrounding text. The background image might appear below the text, or perhaps off to the side (like we’ve done here) by way of a wider left padding.
blockquote {
margin: 1em 20px;
padding-left: 50px;
background: transparent url(quote.gif) no-repeat; }
Drop-Caps and Styled Lines
Borrowing from my Book-Style Chapter Introductions article, we can also distinguish our blockquotes by using drop-caps, stylized text, or (in this example’s case) both at the same time. Here, we’re making use of the first-letter and first-line pseudo-classes, so browser support may not be 100% in older browsers.
blockquote {
margin: 1em 2em;
border-left: 1px dashed #999;
padding-left: 1em; }
blockquote p:first-letter {
float: left;
margin: .2em .3em .1em 0;
font-family: "Monotype Corsiva", "Apple Chancery", fantasy;
font-size: 220%;
font-weight: bold; }
blockquote p:first-line {
font-variant: small-caps; }
Text and Color
Or, if you’d rather go the subtle-but-effective route, you might consider altering the color of the text in the blockquote, as well as the font style or variant. Also in this example, I’m making use of the :before and :after pseudo-classes to insert content into my document – namely, the quotation marks at the beginning and end of the text. Of course, :before and :after aren’t supported by all browsers, so… caveat emptor, and all that.
blockquote {
color: #66a;
font-weight: bold;
font-style: italic;
margin: 1em 3em; }
blockquote p:before {
content: '"'; }
blockquote p:after {
content: '"'; }
You can see all of these examples live here. And if you’ve seen any other great examples of well-styled blockquotes in the wild (or just have a wild idea yourself), I’d love to hear about them: leave me a comment!
There’s more great articles where this came from.





















![Click here for more information. [your ad here] Become a Sponsor! Click here to learn more.](/img/your-ad-here.gif)
On 7/15/2008 at 10:48pm, Justin said,
When you’re done styling, there’s also fun to be had with JavaScript. The blockquote element has a rarely-used cite attribute, and it’s supposed to contain the URL from which the quote was obtained (if applicable). Unfortunately browsers don’t really do anything with it. But JavaScript can see it, so you can have it automatically put a link in for you:
http://heliologue.com/2007/09/18/using-jquery-to-extract-blockquote-metadata/
On 7/16/2008 at 5:39am, Link Drop: Great Stuff Elsewhere | Niki's DesignO'Blog said,
[…] Six Ways to Style Blockquotes (CSS Newbie) […]
On 7/16/2008 at 9:16am, Rob said,
Great link, Justin. In fact, I’m planning an article for the relative-near future (probably early August) that makes use of JQuery, the cite attribute, and blockquotes, but in a different way. But that article’s idea is pretty kick-butt too. :)
On 7/16/2008 at 1:39pm, Great walkthrough of blockqoutes CSS - It'sWebDev! said,
[…] ideas for blockquote designs, great inspiration. Go check it out - Blockquotes css SHARETHIS.addEntry({ title: “Great walkthrough of blockqoutes CSS”, url: […]
On 7/16/2008 at 8:52pm, CSS Brigit |Estilos para un Blockquote said,
Estilos para un Blockquote…
6 tipos de estilo diferentes para un blockquote en CSS Newbie. Puedes ver los 6 ejemplos en este enlace….
On 7/19/2008 at 12:47pm, Knowtebook.com said,
http://www.Knowtebook.com says thank you for these blockquote examples and will link to you in 2 days.
On 7/23/2008 at 11:02am, Six méthodes pour styliser vos citations | Le blog de David Loureiro said,
[…] votre visite!Pour ceux qui veulent avec des citations sympas, voici un article intéressant : Six Ways to Style Blockquotes écrit par Rob Glazebrook sur le site […]
On 7/24/2008 at 7:01am, Four New Blockquotes And How You Can Make Them said,
[…] Block Quotes And Pull Quotes - Examples & Good Practices Simple CSS Blockquotes and Pullquotes Six Ways To Style Blockquotes […]
On 7/24/2008 at 12:36pm, Vote for this article at blogengage.com said,
Six Ways to Style Blockquotes…
Blockquotes do have some styling by default. Most browsers will indent the text in a blockquote tag, which helps the user recognize that the text is different somehow. But who’s to say that we need to stop there? Here are six different ways you could…
On 7/24/2008 at 12:36pm, Geoserv said,
STUMBLED!
Great post, will need to try a couple of these out.
On 7/31/2008 at 5:30pm, Best of July 2008 | Life as a Web Designer said,
[…] Six Ways to Style Blockquotes […]
On 8/1/2008 at 3:06pm, 16+ Tutoriels et Astuces pour vos créations web [Summer Links] said,
[…] Six Ways to Style Blockquotes 6 façons de personnaliser vos blocs de citations […]
Leave a Reply