Hi,
I am very new to css, divs etc and I am having problems with whitespace being left after I use a relative positioning i.e. the whitespace is where the object was originally. In the following code the white space is below the yellow box after the text is moved up.
Any help or advice would be greatly appreciated.
Thanks
Slim
I am very new to css, divs etc and I am having problems with whitespace being left after I use a relative positioning i.e. the whitespace is where the object was originally. In the following code the white space is below the yellow box after the text is moved up.
Any help or advice would be greatly appreciated.
Thanks
Slim
Code:
<style>
div#main{border:solid 1px red; border-color:red; border-style:solid; width:760px;}
div#header{border:solid 1px red; border-color:red; border-style:solid; width:760px;}
div#leftcol{border:solid 1px green; border-color:green; border-style:solid; width:413px; float: left;}
div#rightcol{border:solid 1px blue; border-color:blue; border-style:solid; width:340px; float: left;}
div#footer{border:solid 1px blue; border-color:blue; border-style:solid; width:760px;}
span#leftimage{position:relative; left: 0px; top: 0px; z-index:1;background-color:yellow; height:200px; width:413px}
span#leftextarea{position:relative; left: 10px; top: -80px;z-index:2;}
</style>
<div id="main">
<div id="header">Header</div>
<div id="leftcol">
<span id="leftimage">This is where the image will go</span>
<span id="leftextarea">This text over the image, but why is there a white space below</span></div>
<div id="rightcol">right</div>
<div id="footer">footer</div>
</div>