Inner Shadow with CSS3


/ Published in: CSS
Save to your folder(s)

Use the regular box shadow, but add the keyword "inset" as the last parameter.
Works in Firefox, Safari, Chrome, Opera and IE9.


Copy this code and paste it in your HTML
  1. div{
  2. /* What makes the shadow go inside is the keyword inset at the end */
  3. -moz-box-shadow:0 0 5px rgba(0,0,0,0.5) inset;
  4. -webkit-box-shadow:0 0 5px rgba(0,0,0,0.5) inset;
  5. box-shadow:0 0 5px rgba(0,0,0,0.5) inset;
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.