Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Gator24765

macrumors 6502a
Original poster
Nov 13, 2009
781
3
Texas
Over the last few days I have been learning css.. I am going to go with a three column layout with the center column the main area for my content with one outside column ad based and the other one content based. So my question is can I add a div tag inside of a div tag? how can I add 3 rows within my first column in the picture below so that I can have three different areas for content and ads?

perfect-3-column-dimensions.gif
 
Yes you can have a div within a div, in fact to any level you wish.

As to the three column layout, there are plenty of examples on the web but if you want equal height columns (which makes things easy if you have different coloured backgrounds for each column) then you need to wrap two of the columns in another div.

Code:
<div id="main">
   <div id="wrapper">
       <div id="nav">
       </div>
       <div id="content">
       </div>
   </div>
   <div id="ads">
   </div>
</div>

Then your CSS would float the wrapper div to the left along with its other attributes, one of which should be a positioning attribute of either relative or absolute so that the inner divs can be positioned relative to its coordinates again using float. The "ads" div is floated right.

HTH
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.