开发者

CSS3 boxshadow on top of all other elements?

开发者 https://www.devze.com 2023-03-19 11:46 出处:网络
I have a page setup as follows <div class="Header"> Header content </div> <div class="Content"> Main Body Content </div>

I have a page setup as follows

<div class="Header"> Header content </div>

<div class="Content"> Main Body Content </div>

Now in the CSS for the header class, i'm putting

.Header {
    box-shadow: 3px 3px 10px #000;
}

This box-shadow however gets covered up by the Content div. Is there a way to have the shadow开发者_开发百科 from this div on top of all other divs, without going the absolute positioning route?


You probably want to stick it on a higher z-index. try this:

.Header {
    position:relative;
    z-index:999;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消