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

Edward Z. Yang writes:

> ... authors are recommended to use <pre><code> to wrap all of their
> programming code instead of a lone <pre>, if they wish to be fully
> semantic. This ... makes it extremely difficult to style pre as a
> block for code, as the only semantic indication that the contents of
> the pre block are computer code is its child. You'd end up having to
> say <pre class="code"><code> if you wanted to style pre as well.

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)?

Smylers

Received on Sunday, 22 June 2008 14:32:12 UTC