[html5] What replaces <tt> in HTML5?

Tatham Oddie tatham at oddie.com.au
Tue Apr 28 15:06:05 PDT 2009


Jim,

Just noticed that you mentioned the lack of newlines (first reading I had it
the other way around).

A code tag will apply a mono-spaced font whilst leaving wrapping enabled.

You can always control wrapping via the CSS white-space property as well:

	http://www.w3.org/TR/CSS21/text.html#white-space-prop


Thanks,

Tatham Oddie
au mob: +61 414 275 989, us cell: +1 206 331 5568, skype: tathamoddie,
landline: +61 2 8011 3982, fax: +61 2 9475 5172
my business: tixi.com.au - Ticketing without the dramas


-----Original Message-----
From: help-bounces at lists.whatwg.org [mailto:help-bounces at lists.whatwg.org]
On Behalf Of Tatham Oddie
Sent: Wednesday, 29 April 2009 7:54 AM
To: 'Jim Garrison'; 'Ian Hickson'
Cc: help at lists.whatwg.org
Subject: Re: [html5] What replaces <tt> in HTML5?

Jim,

This sounds like preformatted text to me, which would be a <pre> tag:

http://www.w3schools.com/tags/html5_pre.asp


Thanks,

Tatham Oddie
au mob: +61 414 275 989, us cell: +1 206 331 5568, skype: tathamoddie,
landline: +61 2 8011 3982, fax: +61 2 9475 5172
my business: tixi.com.au - ticketing without the dramas

-----Original Message-----
From: help-bounces at lists.whatwg.org [mailto:help-bounces at lists.whatwg.org]
On Behalf Of Jim Garrison
Sent: Wednesday, 29 April 2009 6:44 AM
To: Ian Hickson
Cc: help at lists.whatwg.org
Subject: Re: [html5] What replaces <tt> in HTML5?

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

I am trying to mark up XML code.  Many of the files I want to display
have few (if any) newlines, so I want to be able to display with
line-wrapping enabled.

>From what you've said, I now believe that <code> is my best bet.

> [...]
>> 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/
> 

Will do.

Thanks,
Jim
_______________________________________________
Help mailing list
Help at lists.whatwg.org
http://lists.whatwg.org/listinfo.cgi/help-whatwg.org


_______________________________________________
Help mailing list
Help at lists.whatwg.org
http://lists.whatwg.org/listinfo.cgi/help-whatwg.org





More information about the Help mailing list