• Hey everybody !
    I need your help !
    I am coding a theme, but i got this error message when i check for html validator :

    Bad value en-EN for attribute lang on element html: Bad region subtag.

    <html dir=”ltr” lang=”en-EN”>

    Syntax of language tag:
    An RFC 5646 language tag consists of hyphen-separated ASCII-alphanumeric subtags. There is a primary tag identifying a natural language by its shortest ISO 639 language code (e.g. en for English) and zero or more additional subtags adding precision. The most common additional subtag type is a region subtag which most commonly is a two-letter ISO 3166 country code (e.g. GB for the United Kingdom). IANA maintains a registry of permissible subtags.

    This is my <Head>
    PS: i am changing CSS in head with a theme_options,
    And i am frensh.

    <!DOCTYPE html>
    
    <!--[if IE 6]>
    
    <html id="ie6" dir="ltr" lang="en-EN">
    
    <![endif]-->
    
    <!--[if IE 7]>
    
    <html id="ie7" dir="ltr" lang="en-EN">
    
    <![endif]-->
    
    <!--[if IE 8]>
    
    <html id="ie8" dir="ltr" lang="en-EN">
    
    <![endif]-->
    
    <!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
    
    <html dir="ltr" lang="en-EN">
    
    <!--<![endif]-->
    
    <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width" />
    	<title>test</title>
    	<meta name="generator" content="WordPress 3.4.2" /> <!-- leave this for stats -->
    	<style type="text/css" media="screen">
    		@import url( http://www.arouen.fr/test/wp-content/themes/Tambourdeville/style.css );
    	</style>
    	<link rel="profile" href="http://gmpg.org/xfn/11" />
    
    	<link rel="shortcut icon" type="image/x-icon" href="http://www.arouen.fr/test/wp-content/themes/Tambourdeville/images/favicon.ico" />
    	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.arouen.fr/test/?feed=rss2" />
    	<meta name='robots' content='noindex,nofollow' />
    <link rel="alternate" type="application/rss+xml" title="test » Feed" href="http://www.arouen.fr/test/?feed=rss2" />
    <link rel="alternate" type="application/rss+xml" title="test » Comments Feed" href="http://www.arouen.fr/test/?feed=comments-rss2" />
    <link rel='stylesheet' id='admin-bar-css'  href='http://www.arouen.fr/test/wp-includes/css/admin-bar.css?ver=3.4.2' type='text/css' media='all' />
    <script type='text/javascript' src='http://www.arouen.fr/test/wp-content/themes/Tambourdeville/scripts/jscolor/jscolor.js?ver=3.4.2'></script>
    <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.arouen.fr/test/xmlrpc.php?rsd" />
    <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.arouen.fr/test/wp-includes/wlwmanifest.xml" />
    <meta name="generator" content="WordPress 3.4.2" />
    			<style type="text/css">
    
    			#header {
    			  width:1024px;
    			  height:200px;
    		}
    				#rap {
    			  width: 1200px;
    			  }
    				#maincontent {
    			  width: 1024px;
    			  }
    				#content {
    			  width: 1024px;
    			  }
    				#header a, #header h1 {
    						 color:#000000;
    						 font-size:18px;
    		}
    
    				.header-description {
    						 color:#000000;
    						 font-size:15px;
    		}
    
    				#access {
    						 width:1024px;
    						 height:23px;
    		}
    
    				#access a {
    						 line-height:23px;
    						 color:#FFFFFF;
    						 font-size:12px;
    						 width:170px;
    		}
    				#access ul ul {
    						 top:23px;
    		}		
    
    				#access ul ul li {
    						 background-color:#0E6CC4;
    		}
    
    				#access ul ul li {
    						 width:175px;
    		}
    
    				#access ul ul a {
    						 color:#FFFFFF;
    						 width:175px;
    						 font-size:12px;
    		}
    
    				#access ul ul :hover > a {
    						 background-color:#739CBE;
    		}
    
    				 #access a:hover {
    						 color:#FFFFFF;
    		}
    
    				#access ul ul li:hover > a {
    						 color:#FFFFFF;
    		}
    
    				#content {
    						 float:Left;
    		}
    
    				.storycontent {
    						 color:#000000;
    						 font-size:12px;
    		}
    
    				#content h2 {
    						 color:#000000;
    						 font-size:24px;
    		}
    
    				#content h3 {
    						 color:#004F87;
    						 font-size:15px;
    		}
    
    				#content h4 {
    						 color:#004F87;
    						 font-size:15px;
    		}
    
    				#content h5 {
    						 color:#004F87;
    						 font-size:15px;
    		}
    
    				#content h6 {
    						 color:#004F87;
    						 font-size:15px;
    		}
    
    				#menu-left {
    						 float:Right;
    						 width:175px;
    
    		}
    				#menu-left a, #menu-left a:visited {
    						 color:#004F87;
    		}
    
    				#menu-left h3 {
    						 color:#063352;
    						 font-size:18px;
    		}
    				#footer {
    						 width:1024px;
    						 height:30px;
    						 color:#3A61AF;
    		}
    				#footer a, #footer a:visited {
    						 color:#3A61AF;
    		}
    		</style>
    						<style type="text/css">
    				#menu-left { margin-left:10px; }
    				</style>
    						<style type="text/css">
    				#access {
    						 background-color:#0734AF;
    		}
    			</style>
    				<style type="text/css">
    			#access li:hover > a {
    						background-color:#0E6CC4;
    						}
    			</style>
    
    						<style type="text/css">
    			#menu-left {  background-color: #F3F3F3; }
    
    			</style> 			<style type="text/css">
    			#footer {  background-color: #F3F3F3; }
    			</style> 			<style type="text/css">
    			 #comments, #postcomment, #commentform {
    				display: none;
    			  }
    			</style> 			<style type="text/css">
    			 #header { background: url("http://www.arouen.fr/test/wp-content/themes/Tambourdeville/images/header.jpg");
    			  }
    			</style> 			<style type="text/css">
    			 #header a, #header h1 { display:none; }
    
    			</style> 			<style type="text/css">
    			 .header-description { display:none; }
    			</style> <style type="text/css" media="print">#wpadminbar { display:none; }</style>
    <style type="text/css" media="screen">
    	html { margin-top: 28px !important; }
    	* html body { margin-top: 28px !important; }
    </style>
    </head>

Viewing 2 replies - 1 through 2 (of 2 total)
  • There’s a couple of problems here. Number one, conditional comments don’t often validate. Still, they can be necessary to support older versions of IE. You definitely don’t need

    <!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
    
    <html dir="ltr" lang="en-EN">
    
    <!--<![endif]-->

    So you can remove that.

    As for your language tag, you just need to use en. Try replacing all of the places where it says lang="en-EN" with lang="en" That should work better. What exactly are you trying to accomplish with all of the directory/language/id tags?

    Thread Starter mathis@Tambour

    (@mathistambour)

    Actually, i am not using : <html id=”ie8″ dir=”ltr” lang=”en-EN”>,
    That’s the code generated ( sorry … )
    I am using : <?php language_attributes(); ?>
    So the code is :

    <!DOCTYPE html>
    
    <!--[if IE 6]>
    
    <html id="ie6" <?php language_attributes(); ?>>
    
    <![endif]-->
    
    <!--[if IE 7]>
    
    <html id="ie7" <?php language_attributes(); ?>>
    
    <![endif]-->
    
    <!--[if IE 8]>
    
    <html id="ie8" <?php language_attributes(); ?>>
    
    <![endif]-->
    
    <!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
    
    <html <?php language_attributes(); ?>>
    
    <!--<![endif]-->

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem w3c’ is closed to new replies.