CSS background shadow (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


ziyath -> CSS background shadow (3/1/2006 13:27:51)

hellow experts

i was wondering how does one come about

puttin a drop shadow on the site with CSS..

i hear its possible..

a shadow or a fade outside the site..

could u please enlighten me..

thanks

ziyath




Tailslide -> RE: CSS background shadow (3/1/2006 13:29:59)

What do you want the dropshadow on?


Edit: ok well - there is in theory a CSS way of adding dropshadows to text but it's badly supported so I'd avoid it.

If you want to add a dropshadow to a photo for instance you could use this method: http://www.alistapart.com/articles/cssdropshadows/

If you want the main text area to have a dropshadow behind it then I'd go for a background-image on the body element and repeat it vertically. Fix it up in Photoshop or whatever then cut it down to a thin slice 2 or 3 pixels high but full width then use that as your background image.




ziyath -> RE: CSS background shadow (3/1/2006 13:39:07)

i want a drop shadown on the whole website...

www.mhrtrading.com

like there...but i want it in css

can u help me...

ziyath




Tailslide -> RE: CSS background shadow (3/1/2006 13:55:55)

I see you're using tables for layout - I'm not sure of an easy way to do this with tables.

What I do is for a 100% high background image (top to bottom of the site)

Mock up the white bit of the central page in Photoshop - make it about 760px wide. Add a dropshadow round it. Crop the image so that it's about 3 pixels high and extends to just outside the fade of the dropshadow. Then I add it to the body element of the CSS:

body {text-align:center; background: white url(images/background.jpg) top center repeat-y;}  (plus whatever other rules you need in there)
#container {margin:0 auto; text-align:left;width:760px;}


That will put the background image centrally down the middle of the page top to bottom and centralise a containing div I've called "container" on top of it.

If you want the dropshadow just in a box with a gap top and bottom then you mock it up the same way in Photoshop but make sure that the central white area AND the dropshadow are within the 760px limit so that the site won't cause scrollbars at 800px resolution. Save it the same way to about 3 pixels high.

Then add it to the container element:

body {text-align:center;}
#container {text-align:left; width:760px; margin: 2em auto; background:white url(images/background.jpg) top center repeat-y;}


This centres the box in the middle of the page - 2ems from the top of the page (obviously change that as needed) with the background just around the central containing box. You can then add the "top" fade and the "bottom" fade as background images of other elements to complete the box.

As you're using tables I suppose you could just stick a containing div around your current table.

Edit: See attached gif file for your background image.




bobby -> RE: CSS background shadow (3/1/2006 19:25:43)

you can also play around with different color and size borders... shades of grey and varying widths can give you a drop-shadow-like effect.

there are a few ways it can be done. how complicated do you want to get?

[:D]




reformed hater -> RE: CSS background shadow (3/31/2006 9:30:16)

There's this one too. I like it and its all using CSS




womble -> RE: CSS background shadow (3/31/2006 11:21:33)

I think that one was the one Spit recommended to me last week - haven't got round to trying it out yet - I got distracted by another project.

*sigh*...so much code, so little time...

(did I mention I HATE javascript? [:@])




reformed hater -> RE: CSS background shadow (3/31/2006 11:27:51)

It is one and the same. I'm in the process of trying it. Hopefully I'll have my terrible site up next week for you all to point and laugh at[;)]




spitfire -> RE: CSS background shadow (3/31/2006 11:39:35)

Feel free to use it - I've got another bookmark [:)]




caz -> RE: CSS background shadow (3/31/2006 13:33:10)

I have used it a few times and found that you have to watch that you have closed all your divs - or else the validator has a fit and you end up in a tangle. [:D]

You can see a current implementation here




dpf -> RE: CSS background shadow (3/31/2006 13:58:53)

quote:

I've got another bookmark
a bookmark and a pixel = one heavily armed man




reformed hater -> RE: CSS background shadow (3/31/2006 14:00:27)

my problem is that i can't get it to be opaque in FF, amongst other stuff that you will point out when I publish the site.




spitfire -> RE: CSS background shadow (3/31/2006 14:10:12)


quote:

ORIGINAL: dpf
a bookmark and a pixel = one heavily armed man

You are forgetting I lost me pixel to the dog. Currently I am pixel-challenged. Guess you could call me a one armed man - if you must.




reformed hater -> RE: CSS background shadow (3/31/2006 14:29:33)

oh and they took down the buy a pixel link... you could have gotten one there Spit.




spitfire -> RE: CSS background shadow (3/31/2006 14:34:53)

Now you tell me[sm=tantrum.gif]




womble -> RE: CSS background shadow (4/1/2006 4:05:16)

[sm=lol.gif]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125