Adjacent elements typically appear as if they were fused, with no lines or seams between them). Example: http://jsfiddle.net/4m3L79w4/1/
However, this does no longer appear to be the case if shadows are in use.
Html:
<div class="top"></div>
<div class="bottom"></div>
Css:
DIV {
background-color: #7faf7f;
width: 400px;
height: 50px;
position: relative;
box-shadow: 0px 5px 20px 5px #000000;
}
.top {
z-index: 2;
}
.bottom {
z-index: 2;
}
The "bottom" element projects shadow over the "top" one, even though both have the same z-index.
JSFiddle: https://jsfiddle.net/b4fvb7e0/1/
Is it possible to make the shadow between the two elements disappear, so that the look fused?
This is actually a simplified version of a header I am trying to create, which in some pages should appear fused to the next element. JSFiddle with the header standalone and with the following element: http://jsfiddle.net/c8oat7vo/3/
Set a pseudo element on top and bottom, and in this one set the shadow.
Also, set z-index of the pseudo elements to -1
fixed z-index issue thank to Jose Gomez