By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,493 Members | 1,936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,493 IT Pros & Developers. It's quick & easy.

Padding of nested divs in IE

P: n/a
Hi,

I have a div (class = "brands") containing other divs, each of which
contains an image. I'm trying to set padding around the images, and my
style seems to work okay on all but Explorer (I'm using v.6). The style is
worded as follows:

..brands img {margin-left: 200px; padding: 10px;}

It looks great on Netscape, but there's no padding on Explorer. What can I
do to remedy this? Any ideas, anyone?

tia,
AGChandler
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"AGChandler" <ag********@comcast.net> wrote:
I have a div (class = "brands") containing other divs, each of which
contains an image. I'm trying to set padding around the images, and my
style seems to work okay on all but Explorer (I'm using v.6). The style is
worded as follows:

.brands img {margin-left: 200px; padding: 10px;}

It looks great on Netscape, but there's no padding on Explorer. What can I
do to remedy this? Any ideas, anyone?


Which doctype are you using?

IE6 only supports padding on images in Standards mode; in Quirks mode
and in IE5.5 and lower it doesn't support padding on images at all.

So you need to use a doctype that triggers standards mode.

..brands img {margin: 10px 10px 10px 210px;}

would work in IE5+ and won't be affected by doctype sniffing.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a

"AGChandler" <ag********@comcast.net> wrote in message
news:x7********************@comcast.com...
Hi,

I have a div (class = "brands") containing other divs, each of which
contains an image. I'm trying to set padding around the images, and my
style seems to work okay on all but Explorer (I'm using v.6). The style is worded as follows:

.brands img {margin-left: 200px; padding: 10px;}


Wouldn't you set the padding in the nested div?

..brands div { padding: 10px; }
..brands img { margin-left: 200px; }
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.