[html5] What replaces <tt> in HTML5?

Jim Garrison jim at garrison.cc
Tue Apr 28 11:00:37 PDT 2009


Hello,

I am trying to figure out the best way to replace <tt> as I migrate to
HTML5.

The best I can come up with so far is:

    <span class="tt">Text here</span>

with the corresponding CSS:

    .tt { font-family: monospace; }

Is this truly the only way to do what I want?

Ideally I would like to be able to say "give me the most appropriate
monospace font considering the current font-family in use" instead of
"give me the default monospace font on the system."  (Just as, for
instance, the <b> element uses the best bold font based on the current
font family)

I'm not sure about fonts typically used on the web, but some font
families do indeed include a monotype counterpart.  Computer Modern is
one that comes to mind.

Cheers,
Jim



More information about the Help mailing list