development:css:box_shadow

CSS: Box shadow

Adding a simple shadow to any rectangle shaped object is quite easy. Here is how to do it cross-browser.

.shadow {
-moz-box-shadow: 3px 3px 5px 6px #ccc;
-webkit-box-shadow: 3px 3px 5px 6px #ccc;
box-shadow: 3px 3px 5px 6px #ccc;
}
  1. The horizontal offset of the shadow, positive means the shadow will be on the right of the box, a negative offset will put the shadow on the left of the box.
  2. The vertical offset of the shadow, a negative one means the box-shadow will be above the box, a positive one means the shadow will be below the box.
  3. The blur radius (optional), if set to 0 the shadow will be sharp, the higher the number, the more blurred it will be.
  4. The spread radius (optional), positive values increase the size of the shadow, negative values decrease the size. Default is 0 (the shadow is same size as blur).
  5. Color
  6. You can put 'inset' after the color definition to make the shadow an inner shadow
Enter your comment:
95 +8 = 
 
  • development/css/box_shadow.txt
  • Last modified: 2019/10/31 09:04
  • by 127.0.0.1