Discuss: Long Live the Q Tag
by Stacey Cordoni
- Editorial Comments
22 Untitled
I think it’s worth noting that if you copy and paste text from a page that uses Q (by itself), no quotes are inserted into the copied text. That makes the Q tag somewhat useless in a semantic regard. (Tested in Firefox and Safari.)
posted at 05:03 pm on September 26, 2006 by Justin Greer
23 I like it
Very well-written. This is a clever solution, barring the potential problems noted. I also like the server-side solution that Brent Royal-Gordon suggested.
One possible issue with the author’s solution is if IE supports the :before/:after pseudo elements before providing support for Q, or vice-versa, one would have to go back to re-address the matter on X-number of sites.
Regarding the server side solution, it may be necessary to specify IE versions down the road if Q support is someday provided. If one is prepared to go back and modify the scripting at some point — which would be needed as we never really know what Microsoft is going to do and thus we can’t address this ahead of time — then this might be a safest and easiest to manage solution.
In any case, very nice article.
posted at 05:15 pm on September 26, 2006 by Mike Cherim
24 usefulness of q tags
Personally I love the Q tags and I use them often when writing for the web. Apart from having a meaning for any web-browsing software, including screen-readers and spiders, apart from adapting to locale, it has one more feature that is very important for me:
Q tags can be styled with CSS.Sure, I can use
<span class=“quotation>&ldqo;<q>something</q>&rdgo;</span>and then use some advanced CSS tricks to actually remove the quotation marks in contexts where I don’t want them. But that’s extremely ugly, and doesn’t allow me to change the quotation marks.
I could change them somehow if the source was
generated server-side every time — maybe. Or I could as well generate a PDF file server-side, and be sure the design is perfect.
But what’s the point?
posted at 05:17 pm on September 26, 2006 by Radomir Dopieralski
25 broken html escaping?
Seems like <, > and & are escaped twice when posting the message. Could maybe somebody fix it?
posted at 05:19 pm on September 26, 2006 by Radomir Dopieralski
26 One big flaw I see...
Just pointing out here that your solution suffers from the same thing you point out as a flaw in the JS solution…
Double quotation marks will appear if and when IE/Win fixes the problem in a future release.
Unless you’re assuming that at the same time, support for the :before and :after pseudo-elements will also be fixed.
posted at 05:20 pm on September 26, 2006 by Steve Paulo
27 what about the QUOTE tag?
I’ve read that things are moving toward quote instead of q, is that right? I’ve been using quote partly for that reason and partly because I prefer to control quotation marks myself. It seems like that’s akin to a period, comma, or other punctuation and I hate to let a browser decide if/when/how it wants to display punctuation – which is essentially content, right?
I’m glad to see someone writing about this again though. It’s tough enough just getting people to stop using blockquote for indentation, so q or quote doesn’t matter much right this moment. :)
posted at 05:31 pm on September 26, 2006 by Natalie Jost
28 XHTML2 (picking up where first commenter left off)
Chris Botman points out the XHTML2 specs for the <q> element. These specs are obviously not set in stone, but shouldn’t we keep an eye toward them for forward compatibility?
As Chris points out, browsers will not render quotation marks by default in XHTML2. So the solution that Stacey provides here is in fact perfect, since it encourages us all to start coding quotes correctly now.
Note, however, that the XHTML2 spec (at least in the example the W3C provides) encourages quotation marks to fall inside the <q> tag, even allowing for quotes within quotes, as follows:
John said, <q>“I saw Lucy at lunch, she told me
<q>‘Mary wants you to get some ice cream on your way home.’</q> I think I will get some at Jen and Berry’s, on Gloucester Road.”</q>
So the conclusion if applying this technique, I presume, would be to include your own quotation marks and put them within the <q> tags.
posted at 05:31 pm on September 26, 2006 by Jim Dalton
29 Good points
I wrote a similar article and totally agree with the author.
Although in the comments on my article some interesting links are posted that point to problems caused by this technique.
posted at 05:52 pm on September 26, 2006 by Harmen Janssen
30 Solution In Search of a Problem
This really seems like a solution in search of a problem to me. Why not just use actual quotation marks, and maybe a <span class=“quotation”> if you really want to style the quotes differently?
I’m sure there are some good reasons, probably involving accessibility, to use <q> tags, but this article doesn’t provide any of them, which leaves me wondering why anyone would ever use the technique described in it. Next time Stacey, try explaining what your technique actually achieves before describing how to implement it.
posted at 06:48 pm on September 26, 2006 by Jeremy Walker
Discussion Closed
New comments are not being accepted, but you are welcome to explore what people said before we closed the door.
Got something to say?
Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.
Create a new account or sign in below if you’d like to leave a comment.
Subscribe to this article's comments: RSS (what’s this?)



21 Ahem
Isn’t this approach an example of “5. Using the Q tag, but also including your own quotation marks.” – one of the solutions you said you didn’t want to use?
I think – if I could be bothered – I’d use an IE-only stylesheet to make q elements italic, and an IE-only script to insert the quote marks and turn the font-style back to normal. That way, the only people who don’t see the quotes are Javascript-off IE users, who get italics instead (which is very far from ideal, but still better than nothing).
Having said that, I use so few inline quotations that it’s really not worth the effort of trying to make q elements work properly. I just sigh and type in plain quotes.
If a practical application ever emerges which actually uses q elements for something, I may reconsider. While it’s just “semantic web” vapourware I’m not losing any sleep over it.
posted at 04:16 pm on September 26, 2006 by Chris Hunt