Posted by Steve Pugh on 12/31/32 11:39
John Salerno wrote:
> Right now the recommendation is to use content-type="text/html" in the
> <head> tag,
No, the recommendation is to set the HTTP content-type header to
text/html
This has nothing to do with <head> or any other html element.
Whilst the meta tag http-equiv="content-type" may be used by browsers
to extract character encoding information under some circumstances it
can not be used to extract content type as the browser will only look
for meta tags inside files it already knows to be HTML. (Though I
suppose IE might do some of its infamous guessing by peeking at the
first few lines of the file....)
> but is that really correct? Should it be
> application/xhtml+xml? I'm wondering if the content-type attribute is
> supposed to parallel the way it's being served
If you want to use the meta tag for some reason then you should have
the same information in the meta tag that you have in the real HTTP
header.
The one exception would be if you are briefly using a server for some
quick demo and that server doesn't let you set the charset parameter at
all (i.e. it serves content-type headers with no charset parameter)
then you can set the character encoding in the meta tag and hope that
browsers use it.
> (or the proper way to
> serve it, meaning eventually we'd have to replace this attribute on any
> XHTML files being written today).
Serve the correct HTTP content-type header - which is text/html for
HTML, and in the real world of IE domination, for Appendix C XHTML 1 -
and optionally include a meta tag with the same values.
Steve
[Back to original message]
|