Adding <!DOCTYPE html> to my page messes up orientation of certain items

Discussion in 'HTML & Website Design' started by dpatel304, Mar 24, 2010.

  1. #1
    When I add:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    to my page, which has messed up the orientation of certain items on my webpage. I managed to manually fix a few of the simpler items, but unable to fix more of the more complicated ones. I feel like all this could be prevented, asI don't see why adding this tag would mess up any of the styling I have done on the site. Is there a way to include this tag, without interfering with the orientation and layout of objects on the site.
     
    dpatel304, Mar 24, 2010 IP
  2. Basti

    Basti Active Member

    Messages:
    625
    Likes Received:
    6
    Best Answers:
    3
    Trophy Points:
    90
    #2
    XHTML 1.0 Strict is most likely causing your problems, while it is the web standart some thing cant be used, try "XHTML 1.0 Transitional" instead. While it is nice to have a validated page which is up to standarts, in my opinion functionality goes above validation.

    Ofc can you layout properbly be fixed using strict as well, but for that we need to know what is actually displaying not correctly
     
    Basti, Mar 24, 2010 IP
  3. dpatel304

    dpatel304 Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you so much for that. I'm not too experienced with web development so wasn't sure what the different doctypes were.

    I'm okay with using a transitional doctype as opposed to a strict doctype, since my site is a simple portfolio site for myself.
     
    dpatel304, Mar 24, 2010 IP
  4. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #4
    @dpatel,
    Basti's reply is nothing but pure crap and you need to ignore everything he said.

    The reason your page changed after you added the doctype is because the doctype is the set of rules you are telling the browser you are following when you created the page. No doctype means you are in quirks mode. With a doctype puts you in standards mode. Change the rules and your page changes along with it.

    The doctype is the very first thing that goes on every page. It is NEVER an afterthought. In addition, NO new web page has any business using transitional over strict. Transitional doctypes are for pages that contain deprecated (old) markup that's being transitioned to current (modern) markup. Since you should never be using deprecated markup, you should never be using the transitional doctype.

    And for people like Basti who think functionality over standards is more important, consider this: standards ARE the functionality of browsers and the web! The browser vendors make those standards and follow them as they make the browser. If they follow them, shouldn't you? People like Basti don't know how to do that so they start forcing things and hacking away till they somehow make it work and jump up and down "Look what I done did!!!".

    If you want your markup to work across all modern browsers, write standard markup and follow the rules.
     
    drhowarddrfine, Mar 24, 2010 IP
  5. asad1912

    asad1912 Greenhorn

    Messages:
    86
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #5
    basti was absolutely correct
    strict tightens things up a bit.

    us transitional instead

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    Code (markup):
     
    asad1912, Mar 25, 2010 IP
  6. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #6
    More from the clueless crowd. Strict does NOT tighten ANYTHING up! At least nothing you would know about and definitely wouldn't understand. Essentially, it's for the sake of the validator while the browser does NOT treat the markup any differently.

    When you don't know what you're talking about, don't respond!
     
    drhowarddrfine, Mar 25, 2010 IP
  7. Basti

    Basti Active Member

    Messages:
    625
    Likes Received:
    6
    Best Answers:
    3
    Trophy Points:
    90
    #7
    LOL, why you bitch around? think you are the smartest? we dont know his errors, so i simply suggested to change the doctype, since the sctrict tag seem to mess his page up he mostly coded "transitional", if chaging fixes his display errors thats fine, if not can be fixed using strict as well. I myself run a "newly" created website with transitional, on certain things is much more enjoyable than strict.
    Tell me what you want, but my transitional coding looks the same in every browser. and that count more to me and properbly many others than brutally force yourself to use strict. I didnt said strict is bad thing or not to use it or things cannot be archieved using it, sometimes its simply easier, especially for people new to these things like (maybe) the OP

    People like you love to mess, iam totally sick of those
    Well, over and out from me. you would never stop arguing anyway, since this is what you are here for.

    BB
     
    Basti, Mar 25, 2010 IP
  8. canadianguy_001

    canadianguy_001 Peon

    Messages:
    97
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I always use transitional. There is no doubt that you should be using a doctype. I don't think strict is necessary, in spite of what dr howard up there says
     
    canadianguy_001, Mar 25, 2010 IP
  9. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #9
    Cause you don't know what you're doing.
     
    drhowarddrfine, Mar 25, 2010 IP
  10. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #10
    Because you advocate not following standards, using deprecated markup and not validating.
    I only know I'm smarter than you.
    His first error would be listening to you.
    How do you know this? Or are you just guessing cause he never said that
    You said use transitional cause it might work better than strict. It won't.
    Absolutely false!

    Absolutely false!
    I'm trying to help the OP. You are giving a disservice by giving false information and making him, and others, more confused when what you are saying proves to be false.
     
    drhowarddrfine, Mar 25, 2010 IP
  11. Basti

    Basti Active Member

    Messages:
    625
    Likes Received:
    6
    Best Answers:
    3
    Trophy Points:
    90
    #11
    Ok, as i guessed the bitching continue, but well think what you want.

    Didnt i said i dont want to discuss this? hmm, was the last post.
    this discussion of ours is not helping the OP in any way, should be continued in pm if needed, we both stated our points.


    Seb
     
    Basti, Mar 25, 2010 IP
  12. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #12
    There's nothing to discuss and leaving now will only confuse him. Perhaps the W3C will enlighten you:
    Or how about one of the HTML Working Group members. Maybe you'll learn something.
     
    drhowarddrfine, Mar 25, 2010 IP