Bit concerned I've missed something obvious with this problem but I'm going to risk it.
I have 2 divs with one acting as a shadow for the other. I want to have them in the center of the page but i cant seem to get the positioning right in terms of the shadow div being offset properly.
If I position absolutely then the div's top left is slap bang in the middle of the page but the shadow effect works correctly. With relative positioning the shadow div just follows on below the other div.
Heres the style..
And the html...
Does anyone know how to have the shadow but align centrally? I thought changing the padding or margin of the portaldivcontainer might work but havent had any luck with it.
Thanks
Matt
"Success is 10% inspiration, 90% last minute changes
I have 2 divs with one acting as a shadow for the other. I want to have them in the center of the page but i cant seem to get the positioning right in terms of the shadow div being offset properly.
If I position absolutely then the div's top left is slap bang in the middle of the page but the shadow effect works correctly. With relative positioning the shadow div just follows on below the other div.
Heres the style..
Code:
.portaldivcontainer
{
width:100%;
border:1px solid;
text-align:center;
}
.portaldiv {
margin-top: 10px;
margin-left: 10px;
margin-right:10px;
width:640px;
border:1px solid #000;
position:relative;
z-index:2;
}
.portaldivshadow{
margin-left:12px;
margin-top:13px;
margin-right:6px;
width:640px;
border:1px solid #999999;
background-color:#999999;
position:relative;
z-index:1;
}
Code:
<div class="portaldivcontainer">
<div class="portaldiv">
hi
</div>
<div id="t" class="portaldivshadow">
</div>
</div>
Does anyone know how to have the shadow but align centrally? I thought changing the padding or margin of the portaldivcontainer might work but havent had any luck with it.
Thanks
Matt
"Success is 10% inspiration, 90% last minute changes