html strict

Discussion in 'HTML' started by WindAndWaves, Jan 10, 2005.

  1. WindAndWaves

    WindAndWaves Guest

    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
    WindAndWaves, Jan 10, 2005
    #1
    1. Advertising

  2. WindAndWaves

    rf Guest

    "WindAndWaves" <> wrote

    > 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;

    --
    Cheers
    Richard.
    rf, Jan 10, 2005
    #2
    1. Advertising

  3. "WindAndWaves" <> wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Jan 10, 2005
    #3
  4. WindAndWaves

    WindAndWaves Guest

    "Jukka K. Korpela" <> wrote in message
    news:Xns95DA67DE9A02Ejkorpelacstutfi@193.229.0.31...
    > "WindAndWaves" <> wrote:
    >
    > > 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.



    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
    WindAndWaves, Jan 10, 2005
    #4
  5. Jukka K. Korpela, Jan 10, 2005
    #5
  6. Jukka K. Korpela <> wrote:

    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    > "http://www.w3.org/TR/html4/strict.dtd">
    >
    > Ref.: http://www.w3.org/TR/html4/struct/global.html#h-7.2
    >
    > The spelling of the keywords DOCTYPE, HTML, and PUBLIC is case
    > insensitive.


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

    --
    David Håsäther
    David Håsäther, Jan 10, 2005
    #6
  7. WindAndWaves

    Toby Inkster Guest

    David Håsäther wrote:

    > Jukka K. Korpela <> wrote:
    >
    >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    >> "http://www.w3.org/TR/html4/strict.dtd">
    >>
    >> Ref.: http://www.w3.org/TR/html4/struct/global.html#h-7.2
    >>
    >> The spelling of the keywords DOCTYPE, HTML, and PUBLIC is case
    >> insensitive.

    >
    > "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".

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Jan 10, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Roberts
    Replies:
    5
    Views:
    2,805
    Rob Roberts
    Jan 20, 2006
  2. KMA

    valid html strict

    KMA, Apr 25, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    424
  3. Tim Streater
    Replies:
    4
    Views:
    319
    Gus Richter
    Feb 13, 2013
  4. Lewis
    Replies:
    0
    Views:
    266
    Lewis
    Feb 12, 2013
  5. Gus Richter
    Replies:
    0
    Views:
    284
    Gus Richter
    Feb 13, 2013
Loading...

Share This Page