Jump to content

Quick question from somebody new to HTML/XHTML (Validation)


LaC0saNostra

Recommended Posts

Hello everybody. I made a sample portal page to learn different concepts using HTML:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<head>
<title>Edward Schubauer</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content ="text/html; charset=utf-8"/>
</head>
<body>
<h1> CSS Samples </h1>
Please visit this website for invention ideas <a href="https://www.kickstarter.com/">Kick Starter</a> <br />
<h2> This is just an example of multiple headers and an image insert using a CSS </h2>
<br />
<p align="center">This is a list of some of my favorite Buffalo Bills football players</p>
<table border="2" width="100%" summary="This table will pose as an example of how easy it is to insert rows and columns using an NFL player">
<tr>
<th id="player">Name</th>
<th id="years"> Professional Career</th>
<th id="position">Position</th>
<th id="age">Age</th>
</tr>
<tr align="center">
<td headers="player">Kiko Alonso</td>
<td headers="years">Buffalo Bills: 2012-2013</td>
<td headers="position">Linebacker</td>
<td headers="age">23</td>
</tr>
</table>
<ul>
<li>EJ Manuel</li>
<li>Fred Jackson</li>
<li>CJ Spiller</li>
<li>Mario Williams</li>
<li>Kyle Williams</li>
<li>Marcel Dareus</li>
</ul>
<p> Let me show an example of blockquotes for you:</p>
<cite> Edward's Summary </cite>
<blockquote> The Buffalo Bills are part of a transitional period in the NFL right now. Their original owner Ralph Wilson had recently resigned. Doug Marrone was appointed the head coaching position. Jim Schwartz will be the new defensive coordinator for the 2014-2015 season. Nathaniel Hackett will continue to be the offensive coordinator for the organization. </blockquote>
<p>
src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
</p>
<p>
<img style="border:0;width:88px;height:31px"
alt="Valid CSS!" />
</a>
</p>
</body>
</html>
My error is in bold when validating and I get this message:
1. Warning in line 3 at character 2: The natural primary language is not specified. It is highly recommended that the "lang" and/or "xml:lang" (for XHTML) attributes be used with the "html" element to specify the primary language. For example, add the attribute lang="en" for English or lang="fr" for French. Specifying the language assists braille translation software, speech synthesizers, translation software, and has other benefits.
2. Comment: XHTML 1.0 Transitional document detected.
3. Comment: 2282 bytes; 1.6s@14.4Kbps, 0.8s@28.8, 0.5s@50, 0.4s@64, 0.2s@128, 0.1s@384, 0.0s@512, 0.0s@768, 0.0s@1.5Mbps, 0.0s@10Mbps.
4. Comment: 0.02s, 0 errors, 1 warning, 0 messages, 3 validator comments, 74 lines, 39 elements (with 33 end tags), 0 document comments, 0 character references, 0 words spell checked (0 in comments), 111 TNPL programs run.
5. Comment: 0 errors, 1 warning, 0 messages, 4 comments.
Just a minor change I assume but I am confused on how to fix this. First time I have come across this error. Any help would always be appreciated.

website.html

post-170676-0-34834200-1392047472_thumb.jpg

css.css

Edited by LaC0saNostra
Link to comment
Share on other sites

Well, the only mistake they're pointing out is that you should indicate the language that the page is in. I don't believe it's a big problem but if you don't want the validator to give you the error add a lang attribute:

 

<html lang="en" ...

Link to comment
Share on other sites

I changed it to: <html lang="en" xmlns="http://www.w3.org/1999/xhtml">

 

My error proceeds:

1. Warning in line 3 at character 7: The XHTML 1.0 recommendation states that both "lang" and "xml:lang" attributes should be used (and set to the same value) when specifying the language of an element. The value of the "xml:lang" attribute takes precedence. For example, add xml:lang="en".
I assume I need to add the: xml:lang="en" as well or do I replace the html lang="en" with the xml:lang="em" ?

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...