Skip to content

Instantly share code, notes, and snippets.

@kannankumar
Forked from ocean90/box-shadow.html
Created August 20, 2017 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kannankumar/c2a1d90a72ac1aa5ef333fb4b64a319b to your computer and use it in GitHub Desktop.
Save kannankumar/c2a1d90a72ac1aa5ef333fb4b64a319b 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>
@kannankumar
Copy link
Author

A little light shadows..

/* Shadows */
.shadow-top {
box-shadow: 0 -10px 20px -5px rgba(115,115,115,0.75);
}
.shadow-right {
box-shadow: 10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-bottom {
box-shadow: 0 10px 20px -5px rgba(115,115,115,0.75);
}
.shadow-left {
box-shadow: -10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-all {
box-shadow: 0 0 20px rgba(115,115,115,0.75);
}
.shadow-top-right{
box-shadow: 0 -10px 20px -5px rgba(115,115,115,0.75),
10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-top-bottom{
box-shadow: 0 -10px 20px -5px rgba(115,115,115,0.75),
0 10px 20px -5px rgba(115,115,115,0.75);
}
.shadow-top-left{
box-shadow: 0 -10px 20px -5px rgba(115,115,115,0.75),
-10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-bottom-right{
box-shadow: 0 10px 20px -5px rgba(115,115,115,0.75),
10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-left-right{
box-shadow: -10px 0 20px -5px rgba(115,115,115,0.75),
10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-bottom-left{
box-shadow: 0 10px 20px -5px rgba(115,115,115,0.75),
-10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-top-bottom-right{
box-shadow: 0 -10px 20px -5px rgba(115,115,115,0.75),
0 10px 20px -5px rgba(115,115,115,0.75),
10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-top-bottom-left{
box-shadow: 0 -10px 20px -5px rgba(115,115,115,0.75),
0 10px 20px -5px rgba(115,115,115,0.75),
-10px 0 20px -5px rgba(115,115,115,0.75);
}
.shadow-inset {
box-shadow: inset 0 0 20px rgba(115,115,115,0.75);
}

Courtesy : Comment by @sksar in original Gist

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