Re: Converting transitional to strict

Discussion in 'HTML' started by Beauregard T. Shagnasty, May 16, 2010.

  1. Alfred Molon wrote:

    > I was trying to convert the pages from my site from transitional to
    > strict and ran into problems.
    >
    > Here is the original transitional page:
    > http://www.molon.de/l/upsgn.html
    > and here is my attempt:
    > http://www.molon.de/l/upsgn1.html
    >
    > A validator check shows 12 errors. BTW, INPUT elements are not allowed
    > anymore in HTML 4?


    Yes, of course they are. See the actual error message:
    "document type does not allow element "INPUT" here; missing one of "P",
    "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag"

    Your <input>s are floating free within <td>s - rather than one of the
    above. They need to be direct descendants of one of those.

    I think you also have mis-level form tags as well. e.g. the <form> and
    the </form> are somehow not inside the same <td>. With all those
    myriads of nested tables, it is very hard to follow so I will let that
    up to you. Looks like you have tables five-deep? Maintenance nightmare.

    > I'm not an HTML expert and I was wondering if perhaps some
    > translators/converters exist, which convert transitional code into
    > strict code. Any ideas?


    Sorry, can't help with that. I've been writing Strict for so long I
    wouldn't know where to look, 'cept Google...

    --
    -bts
    -Four wheels carry the body; two wheels move the soul
    Beauregard T. Shagnasty, May 16, 2010
    #1
    1. Advertising

  2. Beauregard T. Shagnasty

    Rob W. Guest

    Op 16-5-2010 16:23, Alfred Molon schreef:
    > In article<hsosua$u58$-september.org>, Beauregard T.
    > Shagnasty says...
    >>
    >> I think you also have mis-level form tags as well. e.g. the<form> and
    >> the</form> are somehow not inside the same<td>. With all those
    >> myriads of nested tables, it is very hard to follow so I will let that
    >> up to you.

    >
    > Well, it's a form and a table is the simplest way to adjust the layout.



    Seems like a table is not the simplest way to house a div-encapsulated
    form with another table next to it.

    --
    Rob
    Rob W., May 16, 2010
    #2
    1. Advertising

  3. Alfred Molon wrote:

    >> Your <input>s are floating free within <td>s - rather than one of the
    >> above. They need to be direct descendants of one of those.

    [...]
    > Well, it's a form and a table is the simplest way to adjust the
    > layout.


    There's nothing wrong with structuring a form as table, typically with
    labels in one column and corresponding fields in another, and there's
    nothing wrong in letting that create a tabular layout.

    The statement about <input>s floating free within <td>s is misleading. There
    is nothing wrong with <td><input ...></td> as such. A <form> element may
    contain a <table> which must contain a <tr> which may contain a <td> which
    may contain an <input>. No reason to introduce a block level container,
    since <table> is such a container.

    However, e.g. the following is a syntax error, in _any_ version of HTML:

    <div style="margin: 5px;">
    <form method="post" action="gbwrite.php">
    </div>

    When you start a <form> element within a <div> element, you must end (close)
    it there, too.

    >> Looks like you have tables five-deep? Maintenance nightmare.

    >
    > But this page is never changed, no need to maintain it.


    So why are you rewriting it? "There is always someone who rewrites working
    code, to clean it up or to speed it up." And this saying about programming
    applies to HTML authoring as well, with the same ironic tone. (Quite often,
    the result is neither cleaner nor faster, but bugs are introduced, as usual
    in code modifications.)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, May 16, 2010
    #3
  4. Ben C wrote:

    > As for converting pages to strict doctypes, that may be worth doing so
    > as to avoid browser quirks modes and thus increase the probability
    > results will look closer in browsers you haven't tested in.


    If a page has been designed loosely, the odds are that it relies on "quirks"
    mode, so converting it to something that triggers "standards" mode might be
    particularly counter-productive.

    However, if you wish to enhance an existing page e.g. by using CSS features
    that aren't supported by IE in "quirks" mode (there are loads of such
    features), then you might consider changing your DOCTYPE. But only after
    checking that the page, with no enhancements, really works in "standards"
    mode.

    Using Strict syntax is quite immaterial here. What matters is the DOCTYPE
    declaration, at the string level, as a "magic string" that triggers "quirks"
    or "standards" mode - quite independently of actual conformance to the
    declared document type definition.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, May 17, 2010
    #4
    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. Jukka K. Korpela

    Re: Converting transitional to strict

    Jukka K. Korpela, May 16, 2010, in forum: HTML
    Replies:
    65
    Views:
    2,679
    Neil Gould
    Jun 5, 2010
  2. Adrienne Boswell

    Re: Converting transitional to strict

    Adrienne Boswell, May 16, 2010, in forum: HTML
    Replies:
    1
    Views:
    521
    Jukka K. Korpela
    May 16, 2010
  3. Neredbojias
    Replies:
    1
    Views:
    490
    Jukka K. Korpela
    May 16, 2010
  4. dorayme
    Replies:
    1
    Views:
    472
    Neredbojias
    May 19, 2010
  5. GTalbot
    Replies:
    0
    Views:
    539
    GTalbot
    May 20, 2010
Loading...

Share This Page