Mobile app version of vmapp.org
Login or Join
Frith620

: Which is the appropriate content-type meta tag value? I have a question about the meta tag content-type. When starting to build my site (HTML+PHP+JS), I copied a lot of the meta tags over from

@Frith620

Posted in: #MetaTags

I have a question about the meta tag content-type. When starting to build my site (HTML+PHP+JS), I copied a lot of the meta tags over from elsewhere, and I have, amongst others, the following:

<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />


Now, I've seen that tag is being used a lot with the value "text/html". I've been searching the web but could not find a comprehensive explanation regarding what the difference between both is. The "text/html" intuitively sounds more straightforward to me.

Should I change my tag to that, or might the "application/xhtml+xml" be an equivalent solution ?

Alternatively, can anyone point me to a resource where the different values for these tags are listed and explained in a clear manner?

Thanks in advance

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Frith620

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sue5673885

You can find the full answer here: www.w3.org/TR/xhtml-media-types/#intro. However in brief, application/xhtml+xml is for XHTML. That document recommends using HTML 4.01, but I recommend using HTML 5 since there is widespread support for it now. The content type for HTML 5 is

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


Change the charset to whatever you're using. If you don't know or don't want to understand what you're using then just leave it as utf-8 and most things will work.

(The HTML vs XHTML debate is long and complicated, so I won't even attempt to summarise it.)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme