CSS3 to achieve the projection effect

Source: Internet
Author: User

The WebKit engine defines the-webkit-box-reflect property, which enables the projection effect, with the following syntax:

-webkit-box-reflect: <direction> <offset> <mask-box-image>

The property values are described as follows:

<direction>: Defines the direction of reflection, which refers to including above, below, left, and right.

<offset>: Defines the distance of the reflection offset, including the value or percentage, where the percentage is determined by the size of the object and, if omitted, the default is 0.

<mask-box-image>: Defines the mask image that will overwrite the projected area. If the parameter value is omitted, the default is no matte image. You can also set a gradient or solid color overlay.

When the object source changes, the projection is automatically updated, and when the mouse passes over the object, you can see the mouse effect in the projection, and if the property is applied to the <video> label, you can also see the video play with the projection effect. The CSS reflections, such as text and video, can be applied to any object in the page, not just images.

The scale and reflection offsets of the projection do not affect the layout of the page.

Here is an example:

{      -webkit-box-reflect:below;} . Reflect2 {      -webkit-box-reflect:below 10px;} . Reflect3 {     -webkit-box-reflect:below 5px                         -webkit-gradient (linear,left top,left Bottom, from                          ( Transparent),                         color-stop (0.5,transparent), to (White));}

View Run effects

CSS3 to achieve the projection effect

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.