3 replies [Last post]
olliea95
Offline
newbie
London, UK
Last seen: 12 years 25 weeks ago
London, UK
Joined: 2009-06-13
Posts: 1
Points: 0

Hi,

I am trying to align these 3 div tags, each with background images, in a certain way. But I cannot seem to do this. So far I have tried floats, and absolute positioning.

Please can someone give me a line or two that I could add into the CSS definitions of these div tags. The widths of the divs are in the image to help to show what I am trying to achieve.

Ignore the gaps between the boxes, they are not meant to be there.

Thanks so much Smile

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 4 years 20 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

olliea95 wrote:Please can

olliea95 wrote:

Please can someone give me a line or two that I could add into the CSS definitions of these div tags. The widths of the divs are in the image to help to show what I am trying to achieve.

Nope, but you can show us what you've tried with floats and we can help you from there.

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

ABCruz
ABCruz's picture
Offline
Enthusiast
Pilipinas
Last seen: 7 years 31 weeks ago
Pilipinas
Timezone: GMT+8
Joined: 2005-06-16
Posts: 279
Points: 0

Here's an idea if you're

Here's an idea if you're using absolute positioning:

The middle div should have a width and margin: auto. For the left div, use absolute positioning with left to 50% and a negative left margin that's 50% of the middle div plus the width of the left div. Same thing with the right div, only that the left margin should be positive and don't add it's own width to that margin.

:shrug:

I am a Man of Truth.
I am a Free Human Person.
I am a Peacemaker.

http://www.abcruz.com

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 39 weeks 6 days ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

You haven't yet made a case

You haven't yet made a case for three side-by-side containers. What goes in those boxes, aside from the background images? Are they single images? Or, are they tiled?

Provide some specifics, else we're just guessing at the optimal coding.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.