div border differences in IE and firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • faery
    New Member
    • Mar 2007
    • 3

    div border differences in IE and firefox

    In my website I'm using divs with a border around them. The big problem is that IE puts the borders "inside" of the size given, and Firefox puts the border "outside". How can I solve this problem?
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    It sounds like you are having "box model" problems. IE uses the wrong box model for web pages in many instances. To fix it, you need a proper doctype, which I assume you aren't. See the sticky at the top of this board about doctypes.

    Comment

    • AricC
      Recognized Expert Top Contributor
      • Oct 2006
      • 1885

      #3
      Originally posted by faery
      In my website I'm using divs with a border around them. The big problem is that IE puts the borders "inside" of the size given, and Firefox puts the border "outside". How can I solve this problem?
      Post your code so we can see the difference with the two browsers.


      Aric

      Comment

      • faery
        New Member
        • Mar 2007
        • 3

        #4
        Originally posted by drhowarddrfine
        It sounds like you are having "box model" problems. IE uses the wrong box model for web pages in many instances. To fix it, you need a proper doctype, which I assume you aren't. See the sticky at the top of this board about doctypes.
        I read the sticky and put the right doctype in my code, which didn't help.

        I put this in my stylesheet:
        Code:
        div.back
        {
        background-color: #FFFFFF;
        border: 5px solid #CC00FF;
        position:absolute; 
        left: 200px; 
        top: 125px; 
        width: 600px; 
        height: 350px;
        }
        I'm pretty new to this kind of thing, what else do you need?

        Comment

        • faery
          New Member
          • Mar 2007
          • 3

          #5
          hmm, it muist have been the doctype thingie after all... but it's solved now, yay :D

          Comment

          • AricC
            Recognized Expert Top Contributor
            • Oct 2006
            • 1885

            #6
            Originally posted by faery
            hmm, it muist have been the doctype thingie after all... but it's solved now, yay :D
            The Doctype is extremely important! Glad you got things figured out let us know if you have anymore troubles.

            Aric

            Comment

            Working...