Skip to content

Instantly share code, notes, and snippets.

@ocean90
Last active April 11, 2024 13:54
Show Gist options
  • Save ocean90/1268328 to your computer and use it in GitHub Desktop.
Save ocean90/1268328 to your computer and use it in GitHub Desktop.
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
border: 1px solid #ccc;
}
.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;
}
.all {
box-shadow: 0 0 5px #333;
}
</style>
</head>
<body>
<div class="box top"></div>
<div class="box right"></div>
<div class="box bottom"></div>
<div class="box left"></div>
<div class="box all"></div>
</body>
</html>
@willjw3
Copy link

willjw3 commented Sep 28, 2018

Worked for me. Thanks!

@akratellio
Copy link

👍

@AbdallahBedir
Copy link

Thanks

@manzoliric
Copy link

nice :)

@boywondercreative
Copy link

Danke!

@eyecatchup
Copy link

Here's a complete list for one-sided, two-sided and three-sided variants: https://codepen.io/eyecatchup/full/wLZgMJ

@Nelson-J
Copy link

Nelson-J commented Jul 15, 2019

Thanks, great illustration

@WebJax
Copy link

WebJax commented Oct 20, 2019

Great proof

@singhayushh
Copy link

Thanks a ton!
What if I want on the top as well as bottom?

@eyecatchup
Copy link

@MaxIbanez
Copy link

wuoo Thanks you !

@spykelionel
Copy link

Thanks for this dude

@nahimanajz
Copy link

Thanks a lot

@jerobado
Copy link

jerobado commented Jan 6, 2022

This is very helpful! Salamat!

@Mahdisadoghi
Copy link

hello

@greenlife-developer
Copy link

Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment