Click to See Complete Forum and Search --> : tiling background with shadow effect problem


badgerboy
03-13-2007, 12:16 PM
Hi everybody

I've built a site that has a background with a shadow effect at the sides of the main container so that the body looks raised. This shadow runs all the way up the sides to the top of the page.

However, I wanted an effect like on this site http://www.mijas-villas.com . The shadow runs along the sides but the top has a margin where there is no shadow. I can't work out how to do this cos I'm quite new to web design.

I made a graphic with a shadow that simply repeats on the y-axis. Is there an easy way of doing this so that it doesn't go all the way to the top- can't work it out.

Thanks for your help!!

WebJoel
03-13-2007, 06:51 PM
<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="" />
<meta name="Author" content="" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<style type="text/css">
body, html {margin:0; padding:0; border:0;} /* Re-sets IE to "zero" for these values */


#outer {position:relative; left:50px; top:50px; border:3px solid #ececec; background-color:#d7d7d7; width:420px; height:430px}
#inner {position:absolute; left:4px; top:-9px; width:400px; height:400px; border:2px solid #b7b7b7; background-color:white; padding:20px 10px 10px 10px;}
</style>
</head>

<body>
<!-- next is OUTER relative div, which is 'beneith' and has the shadows -->
<div id="outer">

<!-- Next is the INNER absolute div which has white background, padding and YOUR TEXT -->
<!-- As you add YOUR TEXT to INNER, it will expand, so you must also expand W & H of OUTER -->
<div id="inner">
<h3>Some Title</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Suspendisse egestas ultricies pede. Phasellus suscipit blandit risus.
Praesent nonummy. In erat. Duis nibh pede, accumsan eu, pulvinar et,
volutpat vel, elit. Curabitur nec dui sed nunc congue tempus. Nulla ac
dui ac libero fringilla nonummy. Maecenas ullamcorper sodales risus.
Vivamus pretium dolor. Proin eu turpis. Phasellus ut mauris non nulla
mattis luctus. Nunc porttitor dapibus sapien. In malesuada fermentum
metus. Nulla egestas, tellus a vestibulum pharetra, nunc purus auctor
lacus, ut semper purus ipsum eu velit. Praesent dui. Nulla accumsan
turpis at erat.</p>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Morbi lacus felis, euismod at, pulvinar sit amet, dapibus eu, eros.
Etiam tellus. Nam vestibulum porttitor urna. Phasellus aliquet pretium
quam. Proin pharetra, wisi nec tristique accumsan, magna sapien pulvinar
purus, vel hendrerit ipsum tellus at ante.</p>
</div><!-- end INNER -->

</div><!-- end OUTER -->
</body>
</html>