Reply to Re: Transitional validation with "noscript"

Your name:

Reply:


Posted by John Hosking on 09/03/07 17:10

sevillad wrote:

> I was trying to make my main page compliant (as per w3.org) for HTML
> Transitional 4.01, and there's one error I can't solve:

(why not HTML 4.01 strict?)

>
> http://validator.w3.org/check?uri=http%3A%2F%2Fwww.davidsevilla.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&ss=1
>
>>From what I've read around, I think it's related to having "noscript"
> inside a "p". And sure enough, if I remove the noscript, the page
> validates. I have it in place there because I try to get my email in
> the page with Javascript (to avoid some spam) and I want an
> alternative for those who may turn it off. Well, actually it's more
> out of curiosity that I'd like to find a neat solution :)

It's not the <noscript> per se; it's what's inside it.

Your <p> tag is automatically (deemed to be) closed when the parser
comes to the <div> (which happens to be inside the <noscript> on line
50). The closing </p> tag is optional for <p>, and a <p> can't contain
block-level element (of which <div> is a prime example), so the <p> is
considered closed when the <div> shows up.

Later, after the div is opened and closed, the closing tag </p> shows
up, with no paragraph left open to be closed by it. Validation error.

It looks to me like you can just take the div-ness out of your noscript
block, but you'll have to try it and see. If it works, then you can try
changing your doctype to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

--
John
Pondering the value of the UIP: http://improve-usenet.org/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация