473,788 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Padding of nested divs in IE

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
2 2461
"AGChandler " <ag********@com cast.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

"AGChandler " <ag********@com cast.net> wrote in message
news:x7******** ************@co mcast.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4208
by: Paul McKenna | last post by:
Hello Here is my code: <div> <span> ... Flash object... </span> <span> <img src="a.gif">
9
4078
by: Dustin | last post by:
Here's what I am trying to do: (Names represent CSS classes.) I want to create a photo gallery. I want the entire gallery to be surrounded by a box named PhotoGallery. I want a fluid placement of the individual Items within PhotoGallery. An Item is a box that has two child boxes, PhotoBox and Caption. Photobox has an explicit width and height. PhotoBox contains an image whose dimensions may vary, but are constrained to be within...
3
5013
by: Philip | last post by:
I am trying to make a bunched of left-floated divs that will be contained in a larger div. the floated divs all contain a left-floated img and text of varying sizes. If I don't set a height (or height:auto) the larger div doesn't seem to see the nested divs, and they spill out the bottom. IE seems to automatically resize the larger div as long as I set the height to 100% or any pixel size. Mozilla doesn't recognize the percent, and...
0
4516
by: Red | last post by:
See http://reenie.org/test9.php There are two examples each with three nested divs. The only difference between the two is that the first example has no padding in the inner div, the second has 10px padding in the inner div. The middle div has no padding and its black background should not show up at all.
1
1735
by: Geoff Hague | last post by:
http://www.captainsoftheworld.com/test/index.html http://www.captainsoftheworld.com/test/HarrisRoadCinemas.css My problem involves the parent DIV (called #FrontPageListings) and the two other DIVs it contains (#NowPlaying and #ComingSoon). I've coloured the inside of the parent DIV light blue (aqua) to better illustrate what's going on. Firefox seems to be doing what I'd expect the DIVs to do: the two inner DIVs
26
8409
by: Spondishy | last post by:
Hi, I have a problem with divs and padding in IE6 and Firefox. Basically my example that I have attached works exactly how I want in IE6, but padding is treated differently in Firefox. My example is below. http://www.villas2u.com/example/test.htm http://www.villas2u.com/example/styles.css I realise that the issue is with the padding of 10px pushing the
2
4406
by: Remi Villatel | last post by:
Hi there, I have following CSS definitions: div.limits { margin: 0 20px 0 20px; } div.halfleft { float: left; left: 0; width: 50%;
2
1953
by: Guadala Harry | last post by:
Please follow my thinking here and tell me if I'm nuts or if this is a reasonable thing to do given the objective: I'd like to present 3 data values on an aspx page - each styled uniquely, and the total width to be limited to some arbitrary value (400px or so). Given that I'd like to limit the total width, I can't use a <td> because the width specified for a <td> specifies a minimum and not a maximum. Consequently I'll use a DIV...
19
6476
by: Edward | last post by:
Why is it when I have a DOCTYPE line in my HTML then "margin" and "padding" are ignored? This happens in both inline and stylesheet styles. It happens for both XHTML and HTML doctypes. It happens in IE6, IE7 and Firefox (didn't try any others). And when you save the page, the margin/paddings are actually REMOVED from the saved HTML file (!). Why is this?
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.