Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
css ( 3 column list )
Old 05-24-2011, 07:34 PM css ( 3 column list )
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Hi,

I am trying to create 3 equally spaced columns that I can add text to that just works. The one I have now is:

Not equally spaced
and in column 3 it loses it's vertical position when adding to it.

See this page:
http://www.reunitemysite.com/adverti...emium/banners/

I am just trying to make it look correct. Evenly spaced, and stays in position.

The code looks like this:

HTML:
HTML Code:
<ul>
<div id="left"><li>Column 1
<li>test
<li>another test</div>

<div id="center"><li>Column 2
<li>test
<li>another test</div>

<div id="right"><li>Column 3
<li>test
<li>another test</div>
</li></ul>
CSS:
Code:
li {
text-align: left;
}


ul {
margin-left: 100px;
margin-bottom: 20px;
padding: 0px;
text-align: left;
}

#left {
    float:left;
    text-align: left;
    width:30%;
    margin-left: 0px;
    }


#center {
    width:30%;
    padding: 0px auto;
    margin: 0px auto;
    }

#right {
    float:right;
    width:30%;
    margin-top: -40px;
    margin-right: 15px;
    padding-left: -15px;
    text-align: right;
    }
Thanks again!
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 05-24-2011 at 07:38 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-24-2011, 09:23 PM Re: css ( 3 column list )
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
1 put in a proper doctype
2 - correct your code. You can have divs inside a <li> but it does have to be IN the <li> item like this:

<li><div id="blah"> content</div></li>
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-25-2011, 06:13 AM Re: css ( 3 column list )
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
From the looks of it you're trying to split a list (<ul>) into three different areas with div tags. Skip the outer list and position the div tags first, then have a separate list in each div instead.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 05-25-2011, 02:06 PM Re: css ( 3 column list )
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Brian for the last few weeks I've been publishing posts on setting up multi column layouts.

3 Column CSS Layout: Fixed Width And Centered

A similar post for fluid layouts will go live tomorrow morning.

I didn't specifically make the columns equal width, but you should be able to modify the code.

Basically I created 3 divs and floated each to the left. Once you have that set up you could add a list to each column and everything should display as you want.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-25-2011, 05:06 PM Re: css ( 3 column list )
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Define "that just works".

Here's one of my simple layouts
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-25-2011, 09:44 PM Re: css ( 3 column list )
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Define "that just works".

Here's one of my simple layouts
Ok,

I am basically looking for 3 column layout for a category page. I am not going to have many categories, but I would like to have the page ready for what ever is needed to be added to it as far as categories, so I was thinking of creating 3 columns (basically like a table) where I can just fill in the categories as needed, but instead of a table, a div to line things up. And so far, it's not going as planned.

My original code (in the first post) is the only one that works as expected, but it's not fully right because when I add to the 3rd column, it drops un-evenly, which brings me to the point, (finally)...I want to know if it's possible to make all 3 columns equal without using padding or margin adjustment because it seems when I add more columns the more it breaks.

Thanks again
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 05-26-2011, 04:41 AM Re: css ( 3 column list )
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
You should be able to do as Steven wrote. Have three divs and put float left on them. Then add a forth empty div to clear the float. Basically:

Code:
<div class="category_container">Some categories here</div>
<div class="category_container">Some categories here</div>
<div class="category_container">Some categories here</div>
<div class="clear"></div>
Code:
.category_container {
   float:left;
   width: 33%;
   padding: 0;
   margin: 0;
   /* and just to see how they'll look */
   height: 500px;
   border: 1px solid #f00;
}
.clear {
   clear: both;
}
Check out the link Steven provided if you havn't, I thought it was rather clear and should be helpful to you.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 05-26-2011, 07:06 AM Re: css ( 3 column list )
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
My original code (in the first post) is the only one that works as expected, but it's not fully right because when I add to the 3rd column, it drops un-evenly, which brings me to the point, (finally)...I want to know if it's possible to make all 3 columns equal without using padding or margin adjustment because it seems when I add more columns the more it breaks.
In that case it IS a table that you SHOULD be using.
What you have described is a tabular layout, with a capital "T"

Either that or you are going to have a severe case of "divitus"

Just because you can use CSS, does not mean you have to.

A third option would be to style a definition list using the various display: table; properties but this negates the whole idea of "semantic coding". Because you are simply mimicing the very elements you should be using.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to css ( 3 column list )
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.92645 seconds with 12 queries