Porl123 Posted August 29, 2010 Share Posted August 29, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/212017-problem-with-padding/ Share on other sites More sharing options...
haku Posted August 30, 2010 Share Posted August 30, 2010 What IE - there are three in common use, all render differently. Check to make sure you have no HTML errors in your code. Also check to see that you have a doctype - without one IE goes into quirks mode which makes stuff render funny. Quote Link to comment https://forums.phpfreaks.com/topic/212017-problem-with-padding/#findComment-1105140 Share on other sites More sharing options...
Porl123 Posted August 31, 2010 Author Share Posted August 31, 2010 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;">blah@hotmail.com</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. Quote Link to comment https://forums.phpfreaks.com/topic/212017-problem-with-padding/#findComment-1105627 Share on other sites More sharing options...
haku Posted September 1, 2010 Share Posted September 1, 2010 If you've got no errors, then your best bet is to add a conditional comment for IE8 and move it up one pixel. Quote Link to comment https://forums.phpfreaks.com/topic/212017-problem-with-padding/#findComment-1105921 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.