Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default [CSS] Padding Differnet In IE & FF

    Ive coded a layout in IE, but when i view it in firefox the box that i have added padding to is longer than the box in IE.

    On IE its like

    <------------------------ 300px ----------------------->
    <-Padding-><------------Content----------><-Padding->

    But on firefox its like

    __________<------------------------ 300px ----------------------->
    <-Padding-><---------------------Content--------------------------><-Padding->

    Does anyone know how to fix it so its the same in IE and FireFox.
    Lets set the stage on fire, and hollywood will be jealous.

  2. #2
    Join Date
    Dec 2006
    Posts
    3,369
    Tokens
    0

    Latest Awards:

    Default

    Care to post the code?
    PM me for help.



  3. #3
    Join Date
    Mar 2008
    Posts
    779
    Tokens
    0

    Default

    It's because your box has a width. If you remove any widths then it will pad the same in both browsers. I haven't looked up on the cause but there's a solution that I use which is by putting another div inside your main div and putting margins on the inner div. This means it acts like padding but works in all browsers.

    Like so...
    HTML Code:
    <div class="outer">
    
    <!-- this one has the margins in it's CSS to act like padding -->
    <div class="inner">
    
    <p>Text or whatever...</p>
    
    </div>
    
    </div>
    I hope that helps a little

  4. #4
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    Quote Originally Posted by Klydo View Post
    It's because your box has a width. If you remove any widths then it will pad the same in both browsers. I haven't looked up on the cause but there's a solution that I use which is by putting another div inside your main div and putting margins on the inner div. This means it acts like padding but works in all browsers.

    Like so...
    HTML Code:
    <div class="outer">
    
    <!-- this one has the margins in it's CSS to act like padding -->
    <div class="inner">
    
    <p>Text or whatever...</p>
    
    </div>
    
    </div>
    I hope that helps a little
    Indeed that is correct , By having an container with all the divs inside it the width of the container will limit the inside div so it can't apply the padding outside the div controlling it .

    If you were to make it so it uses two different stylesheets for the browsers , the 'equation' for the correct amount of padding on FF would be width - the padding to give you the new width

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •