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:-

  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, if set to 0 the shadow will be sharp, the higher the number, the more blurred it will be.
  4. Color

And that’s all to it.

Alhumdulillah.


References:
http://css-tricks.com/snippets/css/css-box-shadow/

Advertisement

Entry filed under: CSS, Design, Graphics, HTML, Style Sheet, Web Design, XHTML. Tags: .

How to sync Google Calendar with Thunderbird

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


The Author

A meticulous freelance designer & developer based in Hong Kong with expertise in web development, print design, and search engine optimisation.

Availability

Now available for work !

Contact me for a free consultation / quotation at aziz(at)ibnaziz.hk.

Recent Posts

Categories

Blog Stats

  • 101,938 hits

Follow

Get every new post delivered to your Inbox.