Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

HTML validation errors

Posted on 2007-07-22
4
Medium Priority
?
186 Views
Last Modified: 2012-05-05
Hi,

I'm trying to validate my web page, but I'm getting errors I don't understand.

Here are the lines in question:

<ul class="top">
      <span style="text-align:right;"> <li class="top"> <a href="#Link Sites">
            Back to Top</a></li></span>
</ul>      

Error messages:
start tag for "LI" omitted, but its declaration does not permit this.

document type does not allow element "LI" here.

Here is my doc type:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"


0
Comment
Question by:Lucynka
  • 2
4 Comments
 
LVL 28

Assisted Solution

by:TName
TName earned 1200 total points
ID: 19545095
Don't wrap the <li> in a <span>, so don't place another wrapping layer between ul and li...
0
 
LVL 10

Assisted Solution

by:Jaax
Jaax earned 800 total points
ID: 19545107
I think the span right after the UL is the culprit. UL expects LI immediately beneath it.
Try removing the span from its currnet location and place it inside the LI
Hope iit helps
0
 
LVL 28

Accepted Solution

by:
TName earned 1200 total points
ID: 19545112
E.g. you could do something like this:

<ul class="top">
       <li class="top" style="text-align:right;"> <span><a href="#Link Sites">
            Back to Top</a> </span> </li>
</ul>      

or without span:

<ul class="top">
       <li class="top" style="text-align:right;"> <a href="#Link Sites">
            Back to Top</a> </li>
</ul>      
0
 
LVL 1

Author Comment

by:Lucynka
ID: 19547480
Yes, that worked. Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question