[whatwg] Semantic use of the <font> element
Brady J. Frey
brady at dotfive.com
Thu Apr 12 15:05:28 PDT 2007
That's an interesting one - but the idea of semantics for html is to
use an element of meaning, which the font tag lacks in every case as
it's a visual not a content representation? This is the same failure as
using a span tag for your example, since span has no meaning. The sad
part here is that if you want to have a visual representation in your
HTML, you're going to have to use CSS or an image to display the example.
So span is just as bad as font in this case, it lacks meaning, though I
get what you're implying. Side note, there's no point in a break either
if you're using a block level element, which implies the structure of
In the end, you've got a header element, and that's what the html should
be displaying - it's the header of a document or document portion. How
it looks is not semantic, even if it's a visual representation of a
subject, that's the reason for CSS and/or images. If your way were true
I could argue:
<blue type="square">This is a blue square</blue>
Nicholas Shanks wrote:
> I have a website which discusses typography, web design, and computer
> fonts. It recently occurred to me that my use of spans with style
> elements was not really the most semantic method of getting across my
> meaning, and I would be better using the font element.
> My content goes something like this:
> <span style="font-family:Helvetica">This is a sample of
> <span style="font-family:Arial">This is a sample of Arial</span>
> Which loses its visual meaning if the CSS is stripped, overridden, or
> not understood, and further more I cannot supply fallback fonts (since
> that would create a misleading visual appearance) and so here
> contradict the CSS guidelines for the font-family property.
> Would it not be more correct to use:
> <font face="Helvetica">This is a sample of Helvetica</font><br>
> <font face="Arial">This is a sample of Arial</font>
> In this instance I am saying to the browser that the font is the
> critical part of that run of text, and the fact that <font> doesn't
> support fall-back works in my favour here, as well as the usage being
> fully compatible with graphical UAs.
> - Nicholas.
More information about the whatwg