Skip to content

Instantly share code, notes, and snippets.

@albertywu
Created July 10, 2014 16:17
Show Gist options
  • Select an option

  • Save albertywu/c1ca020f3cff799f8a10 to your computer and use it in GitHub Desktop.

Select an option

Save albertywu/c1ca020f3cff799f8a10 to your computer and use it in GitHub Desktop.
.box {
width: 100px;
height: 100px;
border: 10px solid blue;
margin: 30px;
}
.out {
box-shadow: 10px 0;
}
.in {
box-shadow: inset 10px 0;
}
.corner {
box-shadow: 10px 10px;
}
.around-out {
box-shadow: 0 0 0 10px green;
}
.around-in {
box-shadow: inset 0 0 0 10px green;
}
.out-blur {
box-shadow: 10px 0 10px;
}
/* setting a negative spread shrinks the box shadow size, and prevents it from spilling to adjacent edges. */
.out-blur-nospill {
box-shadow: 10px 0 10px -5px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="box out"></div>
<div class="box in"></div>
<div class="box corner"></div>
<div class="box around-out"></div>
<div class="box around-in"></div>
<div class="box out-blur"></div>
<div class="box out-blur-nospill"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment