Page 1 of 1

Size Div to content

Posted: Fri Apr 13, 2007 4:20 am
by iknownothing
Hey guys,
Im currently doing a site, obviously. What I want is to have the divs on the page size to the content. I've used position:absolute, but obviously that doesn't work. I'm only just starting with "float", and its just not working for me, and it's not a very table friendly design either...

I've included a rough version of the cells/divisions it needs to have, and if anyone could give me pointers, it would be great.

Thanks.

Image

Posted: Fri Apr 13, 2007 5:20 am
by matthijs
I should know some more. Is the site fixed-width or fluid/flexible? (in the horizontal I mean)

Code: Select all

<body>
<div id="header">
<h1>Logo</h1>
</div>
<div id="maincol">
bla bla
</div>
<div id="subcol">
blabla
</div>
<div id="footer">foot</div>
</body>

Code: Select all

body {width:800px;margin:0 auto;padding:0;}
#header {height:120px;}
#maincol {float:right;width:550px;}
#subcol {width:200px;float:left;}
#footer {clear:both;}
That's the base

Posted: Fri Apr 13, 2007 7:52 pm
by iknownothing
its fixed width, but height stretch.

Posted: Sat Apr 14, 2007 1:50 am
by matthijs
Then what I showed should basically do it.