views:

26

answers:

1

Hi guys.

I did a "shadow" effect but the "div" elements must have a relationship (father and son)

<style>
    body {
        padding-left: 47px;
        padding-top: 114px;
    }

    div {
        font-size: 60px;
        position: relative;
    }

    div div {
        left: 3px;
        position: absolute;
        top: 3px;
    }
</style>

<div>
    shadow

    <div>
        shadow
    </div>
</div>

Can I make the same thing with separate elements like this bellow ?

<div>shadow</div>
<div>shadow</div>

Thanks :)

A: 

You can position both elements absolute, relative to their common parent, each with a different offset.

jeroen