1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Doctype confusion and other W3 questions

Discussion in 'HTML & Website Design' started by Roze, Jun 22, 2005.

  1. #1
    The homepage of my site shows over 300 errors in the W3 validation program which I just discovered today - i was shocked. In a different thread I learned that bad html can send wrong messages to search engines, I dont know if that's true or not, but I would like to correct these errors if possible.

    http://validator.w3.org/check?uri=h...matically)&doctype=HTML+4.01+Strict&verbose=1

    I'm confused about the Doctype thing. Does anyone have a link of a site that can educate me about the different types of document? I think mine may be set wrong - it was set this way in the original phpNuke theme that I modified. (and apparently I didn't do a very good job ;) )

    Also i'm getting errors like this:

    Line 37, column 14: there is no attribute "BGCOLOR"
    <body [COLOR="Red"]bgcolor="000033"[/COLOR] text="CCCCFF" link="CC0000" vlink="CC0000"
    Code (markup):
    This makes no sense to me, Dreamweaver uses this attribute all the time - is it somehow incorrect?

    Thanks in advance for giving me a clue
     
    Roze, Jun 22, 2005 IP
  2. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It can't help, but it remains to me seen how much it might hurt.

    They should be corrected because it can lead to additional inconsistencies among different browsers.

    You were on the correct site, have a look here at the W3C.

    If you are using a phpnuke template then I wouldn't go about changing the doctype. Then as you add other modules, etc you will constantly be chasing errors as they are expecting your site to be in another doctype. Plus you will likely need to sift through all of the phpnuke core code tracking down errors. I would suggest leaving the doctype as it was and then tracking down errors.

    You are correct that the code is incorrect against the doctype you validated against. Your page was validated against XHTML 1.0 in which the bgcolor attribute doesn't exist. Using CSS to define the bgcolor is expected in XHTML 1.0. Dreamweaver isn't particularly good at writing standards based code.
     
    tflight, Jun 22, 2005 IP
  3. satishtalim

    satishtalim Peon

    Messages:
    440
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
  4. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #4
    minstrel, Jun 22, 2005 IP
  5. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes, the W3C stuff is borning, however you are getting it from the horse's mouth. And I can't believe that Micro$soft suggests that you might not need to declare a doctype!

    Maybe I'm being a little harsh on micro$oft, but to give someone the idea that a doctype isn't important is wrong... if you were only developing sites for IE then it might not matter since their browser doesn't follow any of the rules of HTML anyway. :)
     
    tflight, Jun 22, 2005 IP
  6. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #6
    I just never get tired of seeing that old Micro$oft gag... I've been enjoying that one since about 1980 :rolleyes:

    The problem is you're completely wrong -- that the article doesn't say that at all.

    Did you miss this?

    or this?

    or this?

    or this?

    If you are going to quote an article, don't quote half a sentence in a way that completely changes the meaning of that sentence... that's not only misleading, it's just plain dumb.

    What that sentence ACTUALLY said was:

     
    minstrel, Jun 22, 2005 IP
  7. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi minstrel,

    I agree with what you have said that yes I did leave off parts of the quote. But I still can't think of one reason why "there may be many reasons why you may not want to use a DOCTYPE declaration". That was my point. Your points are well taken.
     
    tflight, Jun 22, 2005 IP
  8. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #8
    I think the article said "there MAY be reasons"... the point being that a DOCTYPE statement isn't absolutely necessary because some pages will display just fine in all or most browsers without one. I also see many people using an incomplete DOCTYPE declaration which throws the browser into quirks mode anyway -- in such cases, they won't see a lot of difference if they omit it.
     
    minstrel, Jun 22, 2005 IP
  9. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Actually, the article does say "there may be many reasons why you may not want to use a DOCTYPE declaration". I agree many sites will display fine without one. However I think it is good practice to always include one. And include the correct one formatted properly. :) Anyway I feel bad that we've sort of derailed the original question by Roze... so I'm going to bow out unless of this thread unless Roze has a followup question. Thanks for the good conversation, minstrel.
     
    tflight, Jun 22, 2005 IP
  10. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #10
    Same to you, Tim. I don't want to belabor the point either, but I'll say one last thing: The article does at least make it clear what will happen if your DOCTYPE is incomplete and that may save people some grief when things don't behave as expected.

     
    minstrel, Jun 22, 2005 IP
  11. Roze

    Roze Guest

    Messages:
    403
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I have some reading to do, thank you for the "plain english" version, I tried to weed through that other stuff once a few months ago but I fell asleep ;)

    Just for fun I "validated" a simple page I made a while back that was purely dreamweaver code - I didn't touch the HTML or use PHP it was all WYSIWYG - still got a ton of errors. I'll fix the doctype thing then don't worry about it.

    I had a thought in all this - I dealt with XHTML pages once in the past because my dropdown menu wasn't working with VBulletin which uses a certain XHTML as the doctype, I had to change the number to make it work, maybe the reading I'll do from the links you sent will explain this to me better. I'm one of those people who learned by trial and error - mostly error, haha.
     
    Roze, Jun 22, 2005 IP
  12. Roze

    Roze Guest

    Messages:
    403
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I do get that part - I test my pages constantly in both IE and FF...occasionally others when I think there might be a problem. Stupid browsers - get a standard!!

    (just an aside, I hate how firefox is smart enough to fix or overlook a few little HTML errors that IE catches...I had a site looking like a disaster for a few days due to an open quote because I didn't open IE to check - learned my lesson!)
     
    Roze, Jun 22, 2005 IP
  13. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I think what you will find is that even though there may be over 300 errors on one page doesn't necessarily mean there are 300 problems to fix. Often just one simple error will cascade into tons of other errors and fixing the first will suddenly clear up many of the rest.

    When validating your homepage against HTML 4.0.1 Transitional there are some large patterns. For example in some of your urls you have the ampersand "&" character. Those need to be encoded so they pass the validator. So if you change them to "&amp;" that ought to clear out quite a few of the errors. You will need to add "alt" tags to your images which will clear up another large chunk of your errors. And some of your unordered lists (ul and li tags) are out of order meaning some were closed that were not open and vice versa.

    Clearing up just those couple of errors ought to reduce the total number of errors significantly.

    And like you mentioned... just because you make a page in Dreamweaver doesn't mean Dreamweaver is writing good code. :( WYSIWYGs are not always good at writing standards compliant code.
     
    tflight, Jun 22, 2005 IP