html strict

W

WindAndWaves

Hi Guys

I have recently changed a site from html to php. In my HTML, I used the

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD">

header and I made sure that the page was validated.

I now do not seem to be able to validate my page any longer because I use a
literal ampersand (&) in one of the links.

What should I do to make it work?

TIA

- Nicolaas
 
R

rf

WindAndWaves said:
I now do not seem to be able to validate my page any longer because I use a
literal ampersand (&) in one of the links.

What should I do to make it work?

&amp;
 
J

Jukka K. Korpela

WindAndWaves said:
I have recently changed a site from html to php. In my HTML, I used
the

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD">

header and I made sure that the page was validated.

The above document type declaration is not correct. In a document type
declaration, the strings within quotation marks are case sensitive.
A validator may choose to use the first one (the formal public identifier)
and not even look at the second one, but declaration is still incorrect and
may trigger "quirks mode" in browsers (though nobody really knows how they
do their doctype sniffing in detail).
I now do not seem to be able to validate my page any longer because I
use a literal ampersand (&) in one of the links.

As "rf" wrote, use &amp; instead. I'm pretty sure the validator's error
message said the same, though perhaps in more general terms. See also the
FAQ entry http://validator.w3.org/docs/help.html#faq-ampersand which refers
to the http://www.htmlhelp.com/tools/validator/problems.html#amp

This has nothing to do with PHP, so I have trimmed followups to alt.html.
 
W

WindAndWaves

Jukka K. Korpela said:
The above document type declaration is not correct. In a document type
declaration, the strings within quotation marks are case sensitive.
A validator may choose to use the first one (the formal public identifier)
and not even look at the second one, but declaration is still incorrect and
may trigger "quirks mode" in browsers (though nobody really knows how they
do their doctype sniffing in detail).


As "rf" wrote, use &amp; instead. I'm pretty sure the validator's error
message said the same, though perhaps in more general terms. See also the
FAQ entry http://validator.w3.org/docs/help.html#faq-ampersand which refers
to the http://www.htmlhelp.com/tools/validator/problems.html#amp

This has nothing to do with PHP, so I have trimmed followups to alt.html.


Cool, thank you both. So what should be my doctype, should I just make it
lower case?

I will look at the ampersand... I just have to see what different it would
make in the PHP code...

Thank you once more

Nicolaas
 
T

Toby Inkster

David said:
"HTML" specifies the root element in that DOCTYPE, so it's not a
keyword :)

Nor is it case sensitive in HTML, right?

In XHTML it must be lowercase: "html".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,342
Messages
2,571,416
Members
48,794
Latest member
massivestack

Latest Threads

Top