Help with DOCTYPE

Discussion in 'HTML' started by Saggy, Aug 31, 2005.

  1. Saggy

    Saggy Guest

    I have designed a webpage that starts with <html> and looks OK....
    however I think I want to put a DOCTYPE tag in front of it (a spider
    simulator told me to).... and when the DOCTYPE tag includes the
    following ..

    "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"

    my website is messed up, in particular, a table I positioned using

    style="position:absolute; left: 10; top:65"

    now is not positioned correctly. What is going on? Do I need that
    line in the DOCTYPE tag, if so, how to get the table in the right
    place??????
     
    Saggy, Aug 31, 2005
    #1
    1. Advertising

  2. Saggy

    WD10 Guest

    On Wed, 31 Aug 2005 11:29:35 -0700, Saggy wrote:

    > I have designed a webpage that starts with <html> and looks OK....
    > however I think I want to put a DOCTYPE tag in front of it (a spider
    > simulator told me to).... and when the DOCTYPE tag includes the
    > following ..
    >
    > "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"
    >
    > my website is messed up, in particular, a table I positioned using
    >
    > style="position:absolute; left: 10; top:65"
    >
    > now is not positioned correctly. What is going on? Do I need that
    > line in the DOCTYPE tag, if so, how to get the table in the right
    > place??????


    Are you using Internet Explorer? If you use something like

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    it switches on "standards compliant mode".

    If you just use something like

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    you will be in "quirks mode".

    A list of DOCTYPES is here:
    http://www.w3.org/QA/2002/04/valid-dtd-list.html

    This page is about XHTML, but explains standards compliant and quirks
    modes:
    http://www.w3.org/International/articles/serving-xhtml/#quirks
     
    WD10, Aug 31, 2005
    #2
    1. Advertising

  3. Saggy

    Saggy Guest

    The same thing happens with EXPLORER or MOZILLA browers..... when I
    include

    "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"


    in the DOCTYPE the absolute positioning doesn't work. So, apparently
    I'm switching from QUIRKS mode to STANDARDS mode, and what worked in
    QUIRKS mode no longer works in STANDARDS mode. Why is that... the
    absolute positioning doesn't seem to work at all in STANDARDS mode...
     
    Saggy, Aug 31, 2005
    #3
  4. Saggy wrote:
    > So, apparently
    > I'm switching from QUIRKS mode to STANDARDS mode, and what worked in
    > QUIRKS mode no longer works in STANDARDS mode. Why is that... the
    > absolute positioning doesn't seem to work at all in STANDARDS mode...


    QUOTE: "my website is messed up, in particular, a table I
    positioned using

    style="position:absolute; left: 10; top:65""

    should be "left:10px; top: 65px". In css, units cannot be
    omitted. In quirks mode, browsers tolerate such
    non-compliant code, in standards mode, they ignore the whole
    rule due to improper syntax which is what standards demand.
     
    Mitja Trampus, Aug 31, 2005
    #4
  5. On Wed, 31 Aug 2005, Saggy wrote:

    > "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"
    >
    > my website is messed up, in particular, a table I positioned using
    >
    > style="position:absolute; left: 10; top:65"
    >
    > now is not positioned correctly.


    You are mistaken. The *correct* treatment of those invalid left and top
    specifications is to ignore them. Any browser which does not ignore them
    is violating a mandatory requirement of the CSS specification, and as such
    has ruled itself out as a www-compatible browser.

    http://www.w3.org/TR/CSS21/syndata.html#parsing-errors

    This may not be what you want, but it -is- what you were asking for.

    > What is going on?


    The solution is to ask for what you want, instead of asking for one thing
    and wanting something different.

    You may find the W3C CSS checker will help you.
     
    Alan J. Flavell, Aug 31, 2005
    #5
  6. Saggy

    Saggy Guest

    As Austin Powers would say .... "Yeah baby" ......

    Works like a charm.

    Thanks
     
    Saggy, Aug 31, 2005
    #6
    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. Ian

    vs.net creates doctype wrong?

    Ian, Jun 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    478
  2. jluo
    Replies:
    5
    Views:
    1,196
  3. Mtek

    DOCTYPE Help

    Mtek, Apr 12, 2008, in forum: HTML
    Replies:
    0
    Views:
    374
  4. Mtek
    Replies:
    1
    Views:
    533
    Jukka K. Korpela
    Apr 12, 2008
  5. Larry Lindstrom
    Replies:
    19
    Views:
    1,305
    Jonathan N. Little
    Jun 12, 2012
Loading...

Share This Page