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
Share on other sites

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.

Link to comment
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;">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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.