home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

What's the correct way to layout this CSS code?

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2474
Discussions: 200,959, Posts: 2,379,554, Members: 246,330
Old April 5th, 2007, 02:40 AM   Digg it!   #1 (permalink)
Member
 
Join Date: Jun 2004
Posts: 178
What's the correct way to layout this CSS code?

Hi

I'm a newbie to CSS - have been playing with it for the last month on my website.

Have been trying to get my head around a layout problem.

Say I have one main DIV, and within it I want three other divs lined up one next to the other. The left and right DIVS are thinner than the middle div.

What is the correct way to acheive this layout?

The way I've done it (which works in Firefox, but not IE), is to float the right DIV to the right, then create a containing DIV for the left and middle DIVS - floated to the left. In the container, I float the left DIV to the LEFT, and the middle div to the right.

So it looks like:

<div id="rightcontent"></div> (floated right)
<div id="container"> (floated left)
<div id="leftcontent></div> (floated left)
<div id="middlecontent></div> (floated right)
</div> (closes container)

In IE, the middle DIV always appears underneath everything else.

DIVS are weird. I swear I would have had this site made a couple of weeks ago with tables, but I want to understand DIVS as they are more efficient.

Cheers

Shaun
__________________
I'm looking for a male vocalist to work with. Go to http://people.aapt.net.au/celebritymusic/s...ikingsmith.html to email me
celebritymusic is offline   Reply With Quote
Old April 5th, 2007, 03:47 AM     #2 (permalink)
Member
 
Join Date: Jun 2004
Posts: 178
I'm missing something fundamental here.

If you place a div within another div, shouldn't the first one expand vertically to accomodate the nested one?

Cheers

Shaun
celebritymusic is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
is E = mc^2 even correct? ShawnD1 IMO Community 39 July 26th, 2009 04:00 PM
How do you get CSS DIV layout to look correct cross browser? celebritymusic Webmastering and Programming 4 April 4th, 2007 11:29 PM
CSS layout? Kphu Webmastering and Programming 12 March 20th, 2007 06:58 PM
Please help me with a little CSS layout celebritymusic Webmastering and Programming 1 March 1st, 2007 10:32 AM
Is the source code Correct..Any For XP netgeek General Tech Discussion 1 August 18th, 2003 10:24 PM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2977)
The disrespect of Obama by Russian .. (45)
Making Health Care Worse (181)
Wireless Televisions. (12)
CPU fan stops spinning randomly (10)
Regular Build (11)
windows 7 problem (7)
Laptop with wireless problem. (5)
windows vista security holes (13)
Is the PSU I received dead? (13)
Point and Shoot Camera Suggestions. (5)
Print spooler problem (16)
radeon x850xt platinum & shader.. (6)
HIS HD5770 graphic card question (15)
Recent Discussions
Nvidia GTX 260 problem (1)
Modern Warfare 2: Who Bought It? (65)
Point and Shoot Camera Suggestions. (5)
CPU fan stops spinning randomly (10)
Is the PSU I received dead? (13)
Print spooler problem (16)
windows vista security holes (13)
Kingston Bluetooth Dongle Driver (1)
Multiple Restarts Required at Boot (3)
Open With ..... Win7 (1)
webcam (0)
upgrade for hp a6101 (0)
Laptop with wireless problem. (5)
tv not turn on-makes clicking sound (2)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Internet Lost (3)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
For Sale BFG GTX285 OC2 with 10 year .. (3)


All times are GMT -4. The time now is 11:17 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28