I need to create a box-shadow on some block element, but only (for example) on its right side. The way I do it is to wrap the inner element with box-shado
Here is a codepen to demonstrate for each side, or a working snippet:
.boxes {
display: flex;
flex-wrap: wrap;
}
.box {
margin: 20px;
border: 1px solid #ccc;
font-family: Helvetica Neue, Arial, sans-serif;
font-weight: 100;
letter-spacing: 2px;
color: #999;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
flex: 1;
padding: 40px;
line-height: 1.4em;
}
.top {
box-shadow: 0 -5px 5px -5px #333;
}
.right {
box-shadow: 5px 0 5px -5px #333;
}
.bottom {
box-shadow: 0 5px 5px -5px #333;
}
.left {
box-shadow: -5px 0 5px -5px #333;
}
Top Only
Right Only
Bottom Only
Left Only