W3C

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.

11 thoughts on “font is dead, vive le style

  1. <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?

  2. “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…

    1. 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.

  3. 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.

  4. Lisbon, 9 of May of 2008.

    How can it be?

    How will one change the font type without having to put another tag?

    Example:

    <P><FONT NAME="arial">
    Hello, <FONT NAME="symbol">a</FONT> there...
    </FONT></P>
    

    It does not make sense!

    (JMLM).

    1. @ Joao.

      Note that the browser will be able to read it, but the document will not be conformant, and that an html 5 conforming tool will not be able to write it.

  5. To me this looks a lot like the question of GOTO in the programming languages. Appear to be a religious fanatic crusade to produce reusable code.

    Off course there are examples of abuse on <font>, but is the simple and direct solution for a lot of specific situations. I’m an old fashioned person that maintain some small web pages on notepad. I really don’t find use for complex style sheet.

    In the past I was a DOS WordPerfect user and even today I found useless the MS-Word complexity when 99.99% of the times use it to write and read very small and simple bussiness letters.

    Another detail, using simple hand coded html 1.0 and a little of common sense my pages looks great on any cell phones and get a decent range on search engines. So on my experience simpler is better, even when is not elegant.

  6. @ JMLM] You use for example a span tag with style=”…” attribute. It’s simpler to use style=”…” everywhere.

  7. @Marco Achury : If you dont wish to use “complex style sheets” then write your Mark-up in HTML 4.01 instead of HTML5.

    Glad this has been implemented, really looking forward to HTML5 being pushed out!

  8. @João: If for some reason you want just that paragraph to have Arial, and it’s not part of a class or such, your code actually gets simpler!

    <P style="font-family: Arial">
    Hello, ? there...
    </P>
    

    Note that with the use of Unicode, you don’t ever have to use the “symbol” font, instead simply include the actual character you want. (In the symbol font on my computer “a” shows up as a Greek Alpha character, so I’ve used that here.)

  9. I’d like to know how to code an initial drop cap into html text. I’ve searched w3schools and Dreamweaver help and can’t find this referenced anywhere. Any assistance is much appreciated!

Comments are closed.