Use CSS to create reflections

Source: Internet
Author: User

-webkit-mask

This property is quite powerful, so the detailed introduction is beyond the scope of this article, and it is well worth digging into because it can save you a lot of time in practical applications.

-webkit-mask makes it possible to add masks to an element so you can create patterns of any shape. The mask can be a CSS3 gradient or a translucent PNG image. When the alpha value of the mask element is 0, the following element is overwritten, and the following is fully displayed for 1. The associated properties are-webkit-mask-clip,-webkit-mask-position, and-webkit-mask-repeat, and are heavily dependent on the syntax from background.

Example

Picture mask:

. mask {  width:50px;  height:50px;  Background:url ("./logo.svg") repeat;  -webkit-mask:url ("./logo.svg");}

Effect:

Example

Gradient Mask:

. mask {  width:50px;  height:50px;  Background:url ("./logo.svg") repeat;  -webkit-mask:-webkit-gradient (linear, left top, left bottom, from (Rgba (0, 0, 0, 1)), to (RGBA (0, 0, 0, 0)));}

Effect:

Use CSS to create reflections

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.