CSS3 Implementing a Shadow effect instance

Source: Internet
Author: User
CSS3 is an upgraded version of CSS technology, and CSS3 language development is evolving towards modularity. The previous specification was too large and complex to be a module, so it was broken down into smaller modules, and more new modules were added. These modules include: Box model, List module, hyperlink mode, language module, background and border, text effect, multi-column layout, etc. In this chapter we will tell you a simple example of a CSS3 shadow effect. A new feature is the use of the Shadow property of CSS3 to add a shadow effect to the elements of a webpage. However, this feature only works on browsers that support CSS3, such as Firefox3.5,safari 3.1 +, and Google Chrome.

Here's how to use the Shadow property of CSS3.

The CSS3 shadow mainly uses the Box-shadow property, which has the following syntax:

Box-shadow:

The values for each of these attributes are as follows:

Horizontal (Horizontal): Specifies the horizontal offset shadow. A positive value (that is: 5px) shadows to the right, and a negative value (that is,-10px) will make it biased to the left.
Vertical (vertical): Specifies the vertical offset shadow. A positive value (that is, 5px) causes the shadow to be at the bottom of the box, and a negative value (that is,-10px) will make it biased.
Blur (Blur): Sets the softening radius. The default value is 0, which means there is no blur. Positive values increase the blur, while negative values actually reduce the shadow. This property defaults to 0.
Clolor (color): The color value, which is the setting of the shadow color.

Reminder: This attribute can be added to any element, slice, div,span,p tag, etc.

Here is an example of a specific shadow, as shown in the sample effect diagram and the specific code:


Above this simple little tutorial on CSS3, hope to help everyone.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.