[html5] What replaces <tt> in HTML5?

Ian Hickson ian at hixie.ch
Tue Apr 28 12:25:14 PDT 2009


On Tue, 28 Apr 2009, Jim Garrison wrote:
>
> I am trying to figure out the best way to replace <tt> as I migrate to 
> HTML5.

Are you using <tt> to mark up computer code, variables, sample computer 
output, user input, for emphasis, to give a span of text in an alternate 
voice or mood, a span of text to be stylistically offset from the normal 
prose without conveying any extra importance, or something else?


> with the corresponding CSS:
> 
>   [...] { font-family: monospace; }
>
> [...]
> 
> 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)

This is a separate question. I don't think CSS has a solution for this 
yet, but I recommend raising it with the CSS working group:

   http://lists.w3.org/Archives/Public/www-style/

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the Help mailing list