/    Sign up×
Community /Pin to ProfileBookmark

Can’t get shadow under absolute positioned div

I can’t see the drop down shadow on a div that is absolute positioned:

.shadow { -moz-box-shadow: 5px 5px 5px #888; -webkit-box-shadow: 5px 5px 5px #888; box-shadow: 5px 5px 5px #888; }

#top { position:relative; width: 100%; height: 45px; padding: 20px 0px 20px 0px; background:url(“../images/mainnav-bg.gif”) 0 50 repeat-x; }

#topbox { position:absolute; padding:5px; top:20px; left:20px; width:150px; height:100px; border:#808080 solid 1px; background: #fff; }

<div id=”top”></div>
<div class=”shadow”>
<div id=”topbox”><img src=”./images/shout.jpg” width=”78″ height=”88″ />
</div>
</div>

If I apply the shadow to anything else it works fine but, not to that “topbox”.

Don’t know what I’m doing wrong.

Thanks in advanced for your help.

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@KorNov 02.2010 — Give your .shadow div a certain size. Or position the .shadow as absolute, not the #topbox.

When you gave to the inner div #topbox the position absolute, you have modified the layout of it's direct parent (.shadow), which became a 0x0 size div.
Copy linkTweet thisAlerts:
@landysaccountauthorNov 03.2010 — That worked.

Thanks.
×

Success!

Help @landysaccount spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...