[CSS disclosure] irregular projection

Source: Internet
Author: User

Difficulties

Normal elements add Border-radius the resulting shape adds box-shadow to the perfect effect. But when ordinary elements add pseudo-elements or translucent decorations, Box-shadow will be a little overwhelmed. Because Boder-radius will shamelessly ignore the transparent part.

Scene:

1. Translucent image, background image, Border-image

2 a dot, dashed, or translucent border, but no background

3. Dialog bubbles generated by pseudo-elements

4. Chamfer shape

5. Chamfer shape

6. Diamond Image

To solve the irregular shape of the projection, the simplest way is to use the filter filter, the greatest advantage of using CSS filters is the smooth degradation.

Common filter filter functions include: Blur () grayscale () Drop-shadow ()

The filter will put any non-transparent part of the projection, so it is not recommended to set the text separately Text-shadow, while the Text-shadow and Box-shadow produced by the shadow effect is two different.

box-shadow:2px 2px 5px rgba (0, 0, 0, 0.5);

Box-shadow

Filter:drop-shadow (2px 2px 5px rgba (0, 0, 0, 0.5));

Filter

Next lecture blur () grayscale ()

[CSS disclosure] irregular projection

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.