Hiya,
I’m a real Dreamweaver/Css novice so please bear with me.
I’m trying to build a site that has one div as a wrapper to hold all the content. This div is centred in the browser window ( and I HAVE worked out how to do that! ) I then want to include content within this box, and this material is itself held inside various divs within the main content wrapper. However, the amount of material held within the wrapper is different on each page, so I need its height to be flexible. And this is where I’m stuck.
If I create a div that extends below the bottom of the wrapper, it just sticks out the bottom, as if it is sitting on top of the wrapper, rather than being contained within it.
I’ve tried setting the height of the div to “auto”, “inherit” and I’ve tried omitting the “height” perameter altogether, but these just make the wrapper div disappear into a small line at the top of the screen. I also tried removing the height and using “overflow:hidden” as per a previous post on here, but this made everything vanish into a thin line at the top of the page.
I know this can be done, because I see many sites with pages of varied lengths held within a content wrapper. So please could someone tell me how it’s done? Or if I’ve made a stupid mistake in my code, please show me!
I’m using Dreamweaver 8. Code is as follows:
<body>
<div id=“wrap”>
<div id=“blue”></div>
<div id=“purple”></div>
<div id=“pink”></div>
</div>
/* CSS Document */
#wrap
{
background-color:#00CC00;
position:relative;
width:700px;
height:500px;
margin:auto;
}
#blue {
background:#3333CC;
position:absolute;
width:200px;
height:200px;
top:100px;
left:100px;
}
#purple {
background-color:#9900FF;
position:absolute;
width:200px;
height:200px;
top:100px;
left:400px;
}
#pink {
background-color:#FF00CC;
position:absolute;
width:200px;
height:200px;
top:369px;
left:400px;
}
</body>
(Yes this is a very odd design! I’m using this to practice the technique, before using it in the real site. In this example, I’d like the blue purple and pink boxes to be fully contained within the green wrapper.)
I hope that all makes sense. Please ask anything else you need to know.
Thanks
13adger