Jump to content

drop shadow effect? (newbie)


brynn

Recommended Posts

Hi Friends,

I'm still pretty much a newbie with CSS. I'm wondering if it's possible to create a sort of drop shadow effect, using CSS.

 

I've written some code, so that I have a div tag with black background, directly underneath another div with a white background (white div 99% width inside the black div tag). But I can't figure out how to make the black div area to show just below and to the right from behind the white one, and not show at the top or left side.

 

The other part of the problem is that the page is mostly fluid, so that I don't have to worry about fixed sizes looking different on different screen sizes/resolutions. Almost everything is in %, except for a couple of places (border width for example).

 

I'm thinking that to achieve the offset drop shadow effect, I can't do it with a white div inside of a black div. And I can completely see how to do it, by using absolute positioning. But how to do it without the nested divs, and with perhaps relative positioning, I can't quite work it out.

 

Here's an example of the code I have. Although again, I'm thinking this would not be the best approach. (The reason for the floats and 30% width, is because there will be 3 of these across the page.) (And another bank of 3 below them.)

<style>.boxfront{background-color:#ffffff;max-width:99%;float:left;margin:0.5%;padding:0.5%;}.boxback{background-color:#000000;max-width:30%;float:left;}</style><body><div class="boxback"><div class="box"><h4>TITLE</h4><p>content </p><p>content </p><p>content </p><p>content </p></div></div></body>

Does anyone have an idea how this might be done?

 

Thank you very much :)

Link to comment
Share on other sites

Oh, thank you very much! That's much easier than I ever imagined, lol. Since I've just started learning CSS, I started with just the basic CSS. I guess I should start thinking about learning CSS3 now, as well -- more bells and whistles :)

 

Thanks again!

Link to comment
Share on other sites

I try to make time once a day (usually first thing in the morning) to read something about coding that I don't know or don't know very well. I will never finish that job..

 

If you need motivation, just remember that coders (and their families) are guaranteed to have enough for the rest of their lives.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...