|
|
|
|
![]() ![]() |
Jan 16 2008, 11:01 PM
Post
#1
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 528 Joined: 13-October 06 From: Alberta, Canada Member No.: 31,584 |
Ok, whenever I try to code a web site using <div></div> tags I run into one problem... the only run vertically... laying on top of one another...... I know there is a way to get div tags to run side-by-side... but how?
(Diagram of what I mean) When I attempt: CODE ************************* Banner ************************* ************************* Content Area ************************* Content Different Content Area ************************* What I want to happen: CODE ************************* Banner ************************* Content Area * Content Area * * * so what css (or whatever else) to get it like that...? |
|
|
|
Jan 16 2008, 11:24 PM
Post
#2
|
|
|
|||[ n00b King ]||| ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 689 Joined: 20-June 07 From: Auckland Member No.: 45,102 |
In your example (2 column) you float content area left and right
CODE <div id='cont_left'> </div> <div id='cont_right'> </div> CODE #cont_left{ float:left; } #cont_right{ float:right; } I think with this method though its going to float all the way to the right and left. so its probably best to have an empty content container with a defined with say 600 px if you want it that wide over all CODE <div id='cont'> <div id='cont_left'> </div> <div id='cont_right'> </div> </div> CODE #cont{ width:600px; } #cont_left{ float:left; } #cont_right{ float:right; } ok unless there is some positioning available to control how far wide out they float and it works well then you dont need to use the above example. This post has been edited by sonesay: Jan 16 2008, 11:31 PM |
|
|
|
Jan 16 2008, 11:38 PM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 528 Joined: 13-October 06 From: Alberta, Canada Member No.: 31,584 |
ok what about padding between them... just like a center float div... or what....
|
|
|
|
Jan 16 2008, 11:55 PM
Post
#4
|
|
|
|||[ n00b King ]||| ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 689 Joined: 20-June 07 From: Auckland Member No.: 45,102 |
You can just define the left and right divs width to equal a value that gives enough space in between them.
|
|
|
|
Jan 17 2008, 04:50 AM
Post
#5
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 4,077 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() |
Here is a sample code showing paragraph tags instead of div's, but the concept is the same since p tags are block level like Div tags. Div's are a generic container, whereas paragraphs deal with text.
CODE <p style="float: left; border: 1px solid red; width: 300px;"> float:left paragraph </p> <p style="float:right; border: 1px dashed red;"> float:right paragraph </p> <p> non-floated paragraph </p> Try it out in your template. Of course, you could move the styles to an external CSs file nand give the p's classes according to their behaviour... Hope this helps. |
|
|
|
Jan 18 2008, 07:09 PM
Post
#6
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 528 Joined: 13-October 06 From: Alberta, Canada Member No.: 31,584 |
thanks to both of you.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th October 2008 - 09:39 PM |