IE Firefox interpret css padding differently

  • crazynorvegian
  • Beginner
  • Beginner
  • crazynorvegian
  • Posts: 62
  • Loc: Austin, TX

Post 3+ Months Ago

I ran into this problem with div's that had set widths were given a certain padding value. In IE, everything was peachy (hold on...) the div's were exactly the right widths, and the content was correctly padded within it. However, in Firefox, everything seemed screwy. The div's were larger than they were supposed to be, but the padding from the edge was still correct. I finally realized that IE was interpreting the padding the way my brain thought padding should work, in that, it applied the padding to the inside of the div. Firefox, on the other hand, did the opposite, it made the div larger by the amount of padding, while keping the content within the set width constraints. Well, to me, that seemed stupid, because if you wanted a div to be yea wide or high, and padding of size x, you had to set your width to the width you really wanted, minus the total width of your padding. And plus, margins are supposed to do the job of "external padding."

Well, thats what I thought....

Turns out, after doing my homework, that by the W3 definitions, the width and height of box elements is the width and height of the content area.
WC3 wrote:
The content edge surrounds the rectangle given by the width and height of the box, which often depend on the element's rendered content.
The job of padding is actually to push the border line away from the edge of the content..

So, now that the lesson is over, (which i hope someone else finds helpful) I'll get around to my question:

For all you experienced CSSers out there, what have you found the best solution to overcoming inconsistencies in css implementations across different browsers?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA
  • crazynorvegian
  • Beginner
  • Beginner
  • crazynorvegian
  • Posts: 62
  • Loc: Austin, TX

Post 3+ Months Ago

awesome, thanks.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 62 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.