Forum Moderators: mack

Message Too Old, No Replies

What is this tag?

text/html

         

pigsinpink

9:57 am on Jul 12, 2007 (gmt 0)

10+ Year Member



When I start a new HTML page, the following tag gets generated after the Doctype. Do you know what it is? Do I really need it or is it excess baggage?


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

I want to code all my pages using XHTML strict doctypes.

BeeDeeDubbleU

10:08 am on Jul 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is Character Encoding (Google it). It is used to tell HTML how to convert bytes into characters and AFAIK it will validate as XHTML.

RonPK

4:28 pm on Jul 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you insist on using XHTML, the content-type should be set to
application/xhtml+xml
, and not
text/html
. Unfortunately, major browsers and search engines do not support application/xhtml+xml, which de facto makes proper use of XHTML impossible. One can of course send XHTML as text/html, but then there's no point in using XHTML.

Here's a classic thread on this subject: Why most of us should not use XHTML [webmasterworld.com].

pigsinpink

8:53 am on Jul 15, 2007 (gmt 0)

10+ Year Member



Thanks for the feedback guys. I didn't know there was so much controversy over XHTML. I've jumped on the bandwagon too...until now. I wish I had asked this question before creating my first site, but I'm lucky I asked it before launching my new site.

lavazza

9:44 am on Jul 15, 2007 (gmt 0)

10+ Year Member



Anyone got any links to pages that ARE and SHOULD BE in xhtml?

I've followed a few links from the xhtml.org index page and from what I can see, none of them extend html at all - instead some of them of stunt it!

encyclo

11:16 am on Jul 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I posted a quick guide to character encoding a while back that you might find useful:

  • Character encoding, entity references and UTF-8 [webmasterworld.com]

    You must declare the character encoding of every page. Often the best way is to use the meta charset element as described above - just place it after the

    <head>
    tag and before the
    <title>
    tag.

    Anyone got any links to pages that ARE and SHOULD BE in xhtml?

    I know of one math professor who combines XHTML and MathML on his site, but other than that you won't find much.

  • pigsinpink

    1:20 am on Jul 16, 2007 (gmt 0)

    10+ Year Member



    Which is the best HTML Doctype to use if you want your pages to use SSI, connect to a database, work well with styles and be able to update for the future?

    encyclo

    2:14 am on Jul 16, 2007 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



  • FAQ: Choosing the best doctype for your site [webmasterworld.com], option 1 or 3. :)
  • pigsinpink

    2:56 am on Jul 16, 2007 (gmt 0)

    10+ Year Member



    Hi Encyclo,

    Option 3 - HTML 4.01 Strict seems the best choice for me.

    Is it o.k for SSI and database connection? I'm still in the learning/implementation stage when it comes to SSI and PHP/MySQL stage.

    By the way thanks for sharing all that info on XHTML :)

    ergophobe

    4:52 pm on Jul 19, 2007 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    I got on the XHTML bandwagon out of ignorance, and then got off. I think encyclo is right on. Unless you're using the math markup or something like that, and truly need the eXtensible part, most of us have no use for XHTML. I don't know why so many people insist that it is better, preferable, more evolved or more standards-compliant.

    On standards compliance, I think that validating to any *strict* DTD is better than validating to some supposedly better transitional DTD. The *strict* standard can be hard to meet with user-contributed content, but it is a higher standard than transitional, which basically means "I want to look cool enough to use XHTML, but I don't really feel like making this good enough to run through a strict validator".

    For more reading on character encoding (somewhat older posts than encyclos, but I don't think mentioned there). The character encoding issue used to come up a bit in the PHP forum:

    [webmasterworld.com...]
    [webmasterworld.com...]