FREE THOUGHT · FREE SOFTWARE · FREE WORLD

Home » CSS »  PullQuotes using CSS

PullQuotes using CSS

by Charles Torvalds 2 comments

[hide]

I looked at a lot of different ways to display quotes and pullquotes and even though the javascript solutions are very nice, esp. the 456bereastreet.com solution, I decided to just use CSS (Keep It Simple Stupid).


Heres what it looks like:

CSS, no javascript pullquote not blockquoteI discovered the "q" tag and tried it out, once it validated as<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">Yes thats XHTML 1.0 Strict. I also checked it with Firefox 1.0*-2.0* and IE 6.0.2*-the new IE 7.0. It also renders perfectly in Opera, Mozilla, and Netscape. Once I learned all that I was completely sold!

Example XHTML:

<q>I can go to bat for them and make it a win-win-win </q><p><strong>"I put a renewal plan togethe</strong>r last year for one of my clients</p><q class="q2">our clients are the ones who really reap the greatest benefits!</q><p><strong>"I have to be sure that I can</strong> get all of the ..sometimes I can go to bat for them and make it a win-win-win etween!"</p>

Example CSS:

q {float:left; width:18em; display:block; margin:0.25em 0.75em 0.25em 1em; padding:0.5em; border:3px double #CCC; border-width:3px 0; color:#333; background-color:#f0f0f0; text-align:center; font:italic 1.3em/1.3 Georgia;}q.q2 {float:left; width:9em; display:block; margin:0.25em 0.75em 0.25em 1em; padding:0.5em; border:3px double #CCC; border-width:3px 0; color:#333; background-color:#f0f0f0; text-align:center; font:italic 1.3em/1.3 Georgia;}

Links

Pure CSS (no js)

  1. Inline BlockQuote Images
  2. Semantic Pullquotes

Good Javascript Examples:

  1. 456bereastreet auto pullquotes

For WordPress:

  1. wp-javascript-pull-quotes/

June 9th, 2007

Comments Welcome

  • Pius

    Really well done, thanks!

  • Stuart Robertson

    Nice work. :) I thought you'd like to see my approach as well: http://www.designmeme.com/articles/csspullquotes/

My Online Tools

Related Articles
Twitter

  • askapache: Make sure you unplug your Ethernet when leaving the room, or disable wifi
  • askapache: My servers, and me, are getting annoyed. Fail2ban works fairly well against all the Chinese brute forcing going on
  • askapache: Can't the Chinese stop ordering their hackers to hack us? Ugh
  • askapache: All I want for my bday is a bottle of American whiskey :)
  • askapache: The first Dino fossil wasn't found until 1822, we sure are young
  • askapache: Htaccess - Ultimate HowTo:  t.co/XMmRKFIWuG 
  • askapache: Show Events that Occurred on this day in the Past:  t.co/5u33s4OolA 
  • askapache: Linux / UNIX: Create Large 1GB Binary Image File With dd Command  t.co/2xs3pvudOz  via @nixcraft
  • askapache: RT @mattcutts: Watch the second half of the Google I/O keynote live:  t.co/BNrX0Pqbn3  Lots of announcements today.
  • askapache: @mattcutts nice!

My Picks
Newest Posts

WordPress Development
Hacking and Hackers

The use of "hacker" to mean "security breaker" is a confusion on the part of the mass media. We hackers refuse to recognize that meaning, and continue using the word to mean someone who loves to program, someone who enjoys playful cleverness, or the combination of the two. See my article, On Hacking.
-- Richard M. Stallman






It's very simple - you read the protocol and write the code. -Bill Joy

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

Site Map | Contact Webmaster | License and Disclaimer | Terms of Service

↑ TOPMain