W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2008

[whatwg] Pre, code and semantics in HTML5: Wishful thinking?

From: Edward Z. Yang <edwardzyang@thewritingpot.com>
Date: Sun, 22 Jun 2008 17:36:53 -0400
Message-ID: <485EC5F5.6020400@thewritingpot.com>
Hash: SHA1

Smylers wrote:
> Why would you need to -- surely you could just put the styling on the
> <code> instead (using pre + code to select only <code> elements inside
> <pre>-s)?

Lets say I want to place a background image of a computer behind spanses
of computer code, but a background image of a console for emulated
console data using samp and kbd.

With HTML 4, I would have done <pre class="code"> (or more likely, just
omitted it and assumed it was computer code by default unless otherwise)
and <pre class="console">.

With <pre><code>, you can't do that. <code> is an inline element, and
the background image doesn't get applied to it in any meaningful way.

I suppose one of the primary distinctions is that if you use
<pre><code>, it's usually because all of it's computer code.

- --
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Received on Sunday, 22 June 2008 14:36:53 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:03 UTC