divs break when doctype added

Discussion in 'CSS' started by roseplant, May 5, 2006.

  1. #1
    I'm very new to using divs for positioning - very much a tables guy up to now. But I'm learning - I have a problem now, that putting in a doctype declaration (tried html4 transitional, xml 1 and 1.1) breaks the left div. It's the page in my sig 'map of turkey' if anyone feels like giving me some advice.
     
    roseplant, May 5, 2006 IP
  2. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Put in xml 1.0 (strict or transitional) and reupload the webpage. You've been designing it in quirks mode so far and infact the doctype is probably correcting the page as to how it should really look.
     
    AdamSee, May 5, 2006 IP
    kk5st likes this.
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    (emphasis added)

    Don't you mean xhtml 1.0? XML is only strict and is not html.

    cheers,

    gary
     
    kk5st, May 5, 2006 IP
  4. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #4
    yeah, that's exactly what I meant.
     
    AdamSee, May 5, 2006 IP
  5. roseplant

    roseplant Peon

    Messages:
    253
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I tried both strict and transitional xml, but they both break it.

    What happens is the left div's border stops after about a centimetre.
     
    roseplant, May 6, 2006 IP
  6. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #6
    It fixes it how it should be viewed, it's completely broken at the moment. You've got to use a doctype, otherwise we can't help you add: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    If you are concerned that the page will be viewed 'broken', create another temp page.
     
    AdamSee, May 6, 2006 IP
  7. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #7

    This is one CSS newbie trying to help another.

    I have broken a couple of pages this way. Two thing to check. Make sure the total of your blocks does not exceed the specifified width of the page. Margins must be included in the total figure.


    You might also be missing a </div> but that usually causes the page to break and display a single column with one div below the other.
     
    Colbyt, May 6, 2006 IP
  8. Greg-J

    Greg-J I humbly return to you.

    Messages:
    1,844
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    135
    #8
    Post your code or a link to the page, it makes it easier to help.
     
    Greg-J, May 6, 2006 IP
  9. roseplant

    roseplant Peon

    Messages:
    253
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks Colbyt, it was a widths/margins issue after all. I had posted a link, by the way Greg (I referred to the 'map of turkey' link in my sig in my first post).
     
    roseplant, May 6, 2006 IP
  10. Greg-J

    Greg-J I humbly return to you.

    Messages:
    1,844
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    135
    #10
    Ahh. My bad roseplant. Good to see you solved your issue.
     
    Greg-J, May 6, 2006 IP