HTML errors in my website

They have: 6 posts

Joined: May 2012

Hi Everyone,

I'm creating my first site for my new business and have come to a bit of a block.

I have used a validator to chack for errors in my site and it has returned these.

Line 78, Column 17: there is no attribute "align"
Line 102, Column 25: end tag for element "strong" which is not open
Line 106, Column 21: there is no attribute "align"
Line 152, Column 94: document type does not allow element "a" here; assuming missing "li" start-tag
Line 153, Column 11: end tag for "li" omitted, but OMITTAG NO was specified
Line 152, Column 21: start tag was here
Line 201, Column 148: there is no attribute "target"
Line 206, Column 134: end tag for element "p" which is not open

I'm completly new to this and as such am completly baffled by what all of this means.
My site is could somebody please help me and tell me what these errors mean and how i can correct them.


Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Hi James,

Welcome to the forums! That's actually a pretty small number of errors for your first time running a validator.

What you need to do is take the source code of your page and find the errors on the line numbers the validator gave you. The view source in Firefox shows line numbers.

The validator is checking your code against the version of HTML specified by your document. If you view the source of your page, you'll see this code at the very top:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

This means that you're using xHTML 1.0 strict. The validator is going to check your code against the xHTML 1.0 specification as defined by the World Wide Web Consortium.

If you start with the first error, and go to line 78, you'll see the code <div align ="right">. The validator is telling you that the align attribute is not allowed in xHTML 1.0 strict. You'll need to take it out and find another way (probably in CSS) to make your div align to the right.

Line 102 is telling you that the <strong> tag does not have a corresponding </strong>.

Line 152 is telling you about a more complex problem. Here, the link tag <a href..., is directly inside the <ul> element defining the list above it. According to the xHTML specification, <ul> can only contain <li> tags directly. You'll need to structure this in some other way (probably put a <li> ... </li> around your link).

The next two about the missing </li> will probably go away once you solve the previous problem. Sometimes the validator lists errors that are actually caused by another error elsewhere on the list. Solve one problem and yo might get rid of several more.

Line 201 - this is similar to the align attribute error earlier.

Line 206 - this means that the paragraph tag wasn't closed properly. In xHTML strict all tags need to be closed, even if it doesn't affect the display of the page on the screen. Here you need to put in a </p> in the appropriate place.

Please let us know if you have anymore questions. I know this sort of thing can be confusing.

dawidtailor's picture

They have: 9 posts

Joined: May 2012

Hello everyone...
I develop my website using HTML when i run the program that time HTML coding error is display so can you suggest me how can i destroy this error and develop my best website.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.