|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
A question on CSS Floating Boxes
I was looking at http://www.thenoodleincident.com/tutorials/box_lesson/boxes.html and like the box idea. But I noticed that they are all Column aligned. Do you know how one would do a 4 box page with only 2 columns ? Four boxes one stacked on top of another, two boxes wide ?? I can't find any reference to it.
|
|
#2
|
||||
|
||||
|
RE: A question on CSS Floating Boxes
I think the easiest way to do this is to start with the two box/two column example and simply duplicate the two boxes to be four (and change the ids accordingly). Also, duplicate the CSS and rename the copy of #content to #content3 and the copy of #content2 to #content4.
So, the CSS looks like: Code:
#content1 { ... }
#content2 { ... }
#content3 { ... }
#content4 { ... }
and the HTML looks like: Code:
<div id="content1"> ... </div> <div id="content2"> ... </div> <div id="content3"> ... </div> <div id="content4"> ... </div> The only problem now is if you want the rows aligned as well as the columns. To do that, use a spacer div between content2 and content3: Add this to the CSS: Code:
div.spacer { clear: both; font-size: 1px; }
And make the HTML look like: Code:
<div id="content1"> ... </div> <div id="content2"> ... </div> <div class="spacer"> </div> <div id="content3"> ... </div> <div id="content4"> ... </div> The spacer's "clear: both;" style is the important part: it pushes everything down until it's past everything on its right and left, so then content3 and content4 can start at the same height. |
|
#3
|
|||
|
|||
|
RE: A question on CSS Floating Boxes
Thanks Honcho, it was the "spacer's "clear: both" that thew me. I'll give it t try.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > A question on CSS Floating Boxes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|