|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Columns help
Hi,
I am trying to setup 2 columns in XHTML, and am wondering how I would get the right column to automatically begin after the left column. PHP Code:
So basically what I'm looking to do is position "rightcolumn" so it begins right after "leftcolumn". I'm not sure how to tho. Right now I'm using absolute positioning, but I'd rather have it all line up automatically rather then having to play with #'s to get it to line up every time. |
|
#2
|
||||
|
||||
|
I'm assuming you mean in a horizontal direction? If so, you can change the following,
Code:
#rightcolumn{float:right;}
A better explanation of the box model and it's uses are available here http://www.w3.org/TR/2002/WD-css3-box-20021024/ <--- your new bible for the day ![]() Also, it would be suggestible to define a size for both right and left div elements. |
|
#3
|
|||
|
|||
|
Thanks for the link mate. I'm reading thru it now.
One thing I noticed is when I placed a float:right on my #rightcolumn it stayed underneath the leftcolumn. Ideally I'd like for them to both line up horizontally, which I'm sure is possible. My CSS so far: PHP Code:
|
|
#4
|
||||
|
||||
|
There are multiple ways to layout a two column page. The most popular use floats or absolute positioning. Very stripped down, they are;
Code:
AP method:
<div id="left" style=
"position: absolute;
width: 50%;">
<p>left hand content</p>
</div>
<div id="right" style=
margin-left: 50%;">
<p>right hand content</p>
</div>
float method:
<div id="left" style=
"float: left;
width: 50%;">
<p>left hand content</p>
</div>
<div id="right">
<p>right hand content</p>
</div>
More on layouts can be found at Glish and /*PIE*/. cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. |
|
#5
|
||||
|
||||
|
PIE = http://www.positioniseverything.net Gary, are you getting soft in your old age?
edit: I powned myself .net NOT .com...
__________________
The Standards! CSS 2 - CSS 3 - w3c CSS Validator - XHTML 1.1 - HTML 4.01 - w3c (X)HTML Validator - ActionScript Reference Links! Bert's Door and Lock Service | Brandon Erik Bertelsen | TextPattern Last edited by 1beb : June 8th, 2004 at 07:02 PM. |
|
#6
|
||||
|
||||
![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Columns help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|