CSS Box Shadow Effect
May 25, 2011 at 1:56 pm Leave a comment
Context:
Having too many graphical images can weigh your website down… but without them, it can start to feel dull and boring. So the best course to take is to utilise CSS to the max. It will make-up for the lack of images, while keeping you light at the same.
The Box Shadow effect is just one example of the many CSS effects, waiting to be used.
Solution:
ie foo.css
.shadow {
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
}
The 4 values correspond to the following respectively:-
- 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.
- 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.
- The blur radius, if set to 0 the shadow will be sharp, the higher the number, the more blurred it will be.
- Color
And that’s all to it.
Alhumdulillah.
–
References:
http://css-tricks.com/snippets/css/css-box-shadow/
Entry filed under: CSS, Design, Graphics, HTML, Style Sheet, Web Design, XHTML. Tags: .
Trackback this post | Subscribe to the comments via RSS Feed