mr.j05hua
mr.j05hua

Reputation: 170

html/css columns

I keep reading that you can use html/css columns without using them in a table. The www.w3schools.org site shows that you can, but I can't get it to work out at all in my code. basically I have this idea.

      <div container="name">
         <dl>item 1 </dl>
         <dd>explain</dd>
         <dl>item 2 </dl>
         <dd>explain</dl>
         ...
      </div>

What I need is for the container to have three columns and the section with the detailed list to be two columns than I will put the info for the third column in its own column. I know the column span is the best way to keep that separate, but I can't find any good explanations for this. And I can't get it to work out of my css page or html page.

Upvotes: 0

Views: 193

Answers (2)

Labu
Labu

Reputation: 2582

Firstly, please don't use w3schools. </rant>

CSS3 has columns built in. Have a read about it here and here.

Upvotes: 0

boz
boz

Reputation: 4907

I think you're going about it the wrong way. Try this.

html:

<div id="container">
    <div id="left-col">
        <!-- left column -->
    </div>
    <div id="content-col">
        <!-- content column -->
    </div>
    <div id="right-col">
        <!-- left column -->
    </div>
</div>

css:

#container { overflow: hidden; width: 940px; }
#left-col { float: left; width: 200px; margin-right: 20px; }
#content-col { float: left; width: 500px; }
#right-col { float: right; width: 200px; }

demo - http://jsfiddle.net/gk5vD/

FYI - you misunderstood what a dl is, have a look at http://www.htmldog.com/reference/htmltags/dl/

Upvotes: 2

Related Questions