« alt attributes authoring practices | Main | WCAG 2.0 takes a giant leap forward — Now it's your turn »

font is dead, vive le style

Ian Hickson, one of the two editors of HTML 5 specification has sent this message this morning on HTML WG mailing-list.

Summary: <font> is gone, style="" is made global.

What does it mean? The font element is part of the list of active formatting elements . The browsers (user agent) have to support the content which is available online following the guideline "Do not break the Web" but the font element has disappeared from the content model.

Basically, there is no way to use a font element to write a conforming HTML 5 document. You, or the authoring tool, will have to use the style attribute.

Filed by Karl Dubost on April 30, 2008 3:00 AM in CSS, HTML
| | Comments (4) | TrackBacks (0)

Comments

Frank # 2008-04-30

<font> is dead for years. Its only (ab)uses were to smuggle in anchors in MediaWikis by using <font id="…">, or to set the foreground colour for a legacy bgcolor= attribute visible with any (GUI) browser", where using CSS for the foreground and bgcolor= for the background can cause havoc when CSS is disabled or unavailable.

Now I'm curious what this comment form does with the essential <tt element, it's the only way to get a <code> / <sample> / <kbd> / <var> effect with numerous applications. Forms allowing to send text to be displayed without a preview function are broken by design.

BTW, who is going to inform Google Page Creator that &lt:font> is dead for ages?

Patrick H Lauke # 2008-04-30

"You, or the authoring tool, will have to use the style attribute."

or even better, you, or the authoring tool, will have to think about why you want to style things a different way (different typeface, different colour, etc), use the most semantically appropriate element, and then define a style for that...

Karl Dubost Author Profile Page # 2008-04-30

Hi Patrick,

The authoring tool will have difficulties to think. ;) For the user it is a bit different, there are different type of things between what you want to do and what you can do with the system.

  • Sometimes systems are constrained and do not give access to a master stylesheet, but just to local modification with a style attribute.
  • When publishing content, there are images with no common sizes (such as the ones defined for a specific class attribute). So you can decide to use a local size for some particular images.
  • offline/online paradigm when the stylesheet is called with a link elsewhere online, you might have to rely on local css.

For authoring tool, it gives the possibility of creating system with different levels of editing of style in the cascade. Not necessary easy all the time, but doable in some circumstances.

Dana Lee Ling # 2008-05-01

In regards the "evils" of inline style: I use HTML to put together quizzes and tests for my courses. To the maximum extent possible, I style everything in external style sheets. A few times a term I hit a unique layout situation where the result does not look quite right, especially when printed out. I either have to add a one-off never again used rule to my external style sheet or, if I choose to alter an existing rule, I risk impacting dozens of pre-existing pages that employed that rule in its original form. In this situation I deploy an inline style rule. Otherwise my external stylesheets would be littered with one-off special rules because a particular layout one Tuesday in June did not look quite right. As for sins, I do confess to having the rule .center {text-align:center} in my stylesheet so I can write class="center" rather than style="text-align:center". Sometimes it is not about semantics but what looks better to the all-too-human reader.

Leave a comment

Note: this blog is intended to foster polite on-topic discussions. Comments failing these requirements and spam will not get published. Please, enter your real name and email address. Every individual comment is reviewed by the W3C staff. This may take some time, thank you for your patience.

You can use the following HTML markup (a href, b, i, br/, p, strong, em, ul, ol, li, blockquote, pre) and/or Markdown syntax.

Your comment


About you

This blog is written by W3C staff and working group participants,
 and maintained by Karl Dubost and olivier Thereaux.
Powered by Movable Type, magpierss and a lot of Web Technology