Forum Moderators: open

Message Too Old, No Replies

Which <!DOCTYPE

         

quarryshark

8:21 pm on Jan 17, 2007 (gmt 0)

10+ Year Member



I have a ecommerce HTML website that I am redoing with css, basically trying to clean up. I am using FP generated template.
I am adding a <!DOCTYPE but not sure which one.
My first though was to use the following
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
But I notice that much of my competition is using a Transitional version.
Any opinions? Advise?
TIA

DanA

8:28 pm on Jan 17, 2007 (gmt 0)

10+ Year Member



If you redo from scratch use the strict doctype.
Re-using your html will be easier with the Transitional version if you want to validate the code.

jimbeetle

8:34 pm on Jan 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you're just going to be using CSS for styling HTML Transitional should be fine. If using CSS for desing layout and posiitioning I find that HTML Strict makes things much easier for me.

quarryshark

8:50 pm on Jan 17, 2007 (gmt 0)

10+ Year Member



I am using the "includes page" components for my layout. Does this make a difference?
I also am using a little Javascript.

encyclo

9:08 pm on Jan 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This earlier thread may help:

  • FAQ: Choosing the best doctype for your site [webmasterworld.com]
  • jimbeetle

    9:34 pm on Jan 17, 2007 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    I am using the "includes page" components for my layout. Does this make a difference?

    No, not at all.

    quarryshark

    10:25 pm on Jan 17, 2007 (gmt 0)

    10+ Year Member



    How important is validating?
    It fails miserably and it seems to be the template. I published a base template, ran the test and recieved the same results. 49 errors.

    jimbeetle

    10:34 pm on Jan 17, 2007 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    49 errors really isn't a lot ;) as some basic errors will cascade, creating more. Fix the first couple or three, then run it through the validator again. Rinse. Repeat.

    quarryshark

    10:57 pm on Jan 17, 2007 (gmt 0)

    10+ Year Member



    Mostly error messages like this:
    Line 14 column 16: there is no attribute "TOPMARGIN".
    the code it's refering to:
    <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" link="#0000FF">

    Should I find a way to run this from the CSS?

    and:
    Line 184 column 77: required attribute "ALT" not specified
    the code it's refering to:
    ...image_top_02.jpg" width="55" height="54"></a></td>

    This makes up about half of the errors.

    jimbeetle

    11:20 pm on Jan 17, 2007 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    Okay, first of all, here's the CSS Level 1 [w3.org] reference.

    As you can see from that, the correct attributes are margin-top, margin-right, etc. And yeah, it would be better to handle this in your CSS file instead of including it on every page.

    And don't forget about the folks over in the CSS forum [webmasterworld.com] for any detailed questions you might have.

    The other is also a simple fix. Alt is a required attribute for the image element. If the image is simply a design element that doesn't have any real meaning you can set the value of the alt to an empty string:

    image_top_02.jpg" alt="" width="55" height="54"

    If the image is meant to communicate something then use the alt to, well, communicate that:

    image_top_02.jpg" alt="Click to order" width="55" height="54">

    image_top_02.jpg" alt="Photo of my store" width="55" height="54">

    Here's the HTML 4.01 spec [w3.org].

    You should have that template validating in no time.

    quarryshark

    12:46 am on Jan 18, 2007 (gmt 0)

    10+ Year Member



    Outstanding! Thanks for the help. :)