Jump to content
xisto Community
KansukeKojima

Calling All Css Experts (i Need Some Help)

Recommended Posts

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:

*************************Banner**************************************************Content Area*************************Content Different Content Area*************************

What I want to happen:

*************************Banner*************************Content Area	 *   Content Area						*						*						*
so what css (or whatever else) to get it like that...?

Share this post


Link to post
Share on other sites

In your example (2 column) you float content area left and right

<div id='cont_left'></div><div id='cont_right'></div>

#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 withsay 600 px if you want it that wide over all

<div id='cont'><div id='cont_left'></div><div id='cont_right'></div></div>

#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.

Edited by sonesay (see edit history)

Share this post


Link to post
Share on other sites

ok what about padding between them... just like a center float div... or what....

Share this post


Link to post
Share on other sites

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.

<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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.