Jump to content
Sign in to follow this  

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

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"
<title>Edward Schubauer</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content ="text/html; charset=utf-8"/>
<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">
<th id="player">Name</th>
<th id="years"> Professional Career</th>
<th id="position">Position</th>
<th id="age">Age</th>
<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>
<li>EJ Manuel</li>
<li>Fred Jackson</li>
<li>CJ Spiller</li>
<li>Mario Williams</li>
<li>Kyle Williams</li>
<li>Marcel Dareus</li>
<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>
src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
<img style="border:0;width:88px;height:31px"
alt="Valid CSS!" />
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.




Edited by LaC0saNostra

Share this post

Link to post
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" ...

Share this post

Link to post
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" ?



Share this post

Link to post
Share on other sites

Adding the xml:lang attribute would solve the problem.

Share this post

Link to post
Share on other sites

If you use HTML rather than XHTML you don't need to use XML attributes. Since HTML 5 is the newest standard XHTML is not used very commonly anymore.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...