Jump to content

Problem with padding


Porl123

Recommended Posts

I've noticed how in internet explorer there's extra padding around html objects like divs, which is a problem for my website design. My design uses an inline div which I need to have no padding. In most other browsers there seems to be a gap of 1 pixel all around the text inside the div, however in IE it looks about 2 pixels, which isn't much but it knocks my design out of balance. This is what I have:

 

<div style="display:inline; padding:0; margin:0px;">Text</div>

 

Is there a way to remove this extra padding in IE? Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/212017-problem-with-padding/
Share on other sites

Yeah I've just used the validator but it didn't return any errors or warnings. I've advanced with the design now and I've got this:

 

<div style="display:inline-block; height:16px; padding:2px 0px 0px 15px; margin-right:10px; background:url(/im/icons/email-1.gif) no-repeat; color:#555;">[email protected]</div>

 

It looks fine in browsers like safari, firefox and opera but again in internet explorer 8 the text seems to be 1 pixel further down than in other browser. Normally I'd just accept it but because of the icon it looks more off than it is.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.