Forum Moderators: open

Message Too Old, No Replies

<meta http or <meta name ?

Correct code?

         

dougie

12:35 pm on Sep 16, 2004 (gmt 0)

10+ Year Member



<meta http-equiv="content-language" content="en">

<meta name="Content-Language" content="en">

Could anyone please let us know which one is correct?

Also, do caps matter ie a big c in content or not?

Any help appreciated.

jetboy_70

12:42 pm on Sep 16, 2004 (gmt 0)

10+ Year Member



<meta http-equiv="Content-Language" content="en">

However, whether this makes any practical difference to how current browsers or search engines handle the page is open to debate.

Current W3C specs say to declare your language in the HTML element, directly after a valid DOCTYPE declaration:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

dougie

12:48 pm on Sep 16, 2004 (gmt 0)

10+ Year Member



Many thanks, much appreciated.

encyclo

12:59 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just to clarify further, jetboy_70's example was for XHTML 1.0. If you are using HTML 4, then you simply need:

<html lang="en">

jetboy_70

1:08 pm on Sep 16, 2004 (gmt 0)

10+ Year Member



Well spotted encyclo. :)

StupidScript

11:37 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My home-rolled interpretation of those two types of META tags goes like this ... and please stomp on me if I'm way off base:

Use "http-equiv" for instructions to the browser application, itself.
i.e.
<meta http-equiv="refresh" content="1; url=page.html">

Use "name" for instructions to other applications.
i.e.
<meta name="keywords" content="search,terms,here">

"http-equiv" causes something to change in the default browser behaviour, where "name" provides information and does not cause a change in behaviour.

Also, HTML is case-insensitive. If it's in an HTML tag (like META), and not script-related, it doesn't matter if you use upper- or lowercase. I tend to use all lowercase, because that's one less key I need to strike during coding.

<wincing in preparation for a stomp> :)