Use CSS3 's radial-gradient to implement a circle with a penetrating effect

Source: Internet
Author: User
First look at the requirements:



, you need to do one of these effects. What do you usually do? The semicircle is cut into pictures to solve a situation where the picture background is fixed and uneven.

If the background picture is a pattern tile, the cut is not fixed? The cut semicircle doesn't correspond to the background map.

Now the radial gradient using CSS3 can achieve this transparent circle, so that if the circle is transparent, do not worry about the background picture of the situation

Background-image:repeating-radial-gradient (500px 500px at 50% 0px, transparent 0, transparent 50px, #0cc 50px, #0cc 200%) ;

Code Explanation:

500px 500px at 50% 0px,

White area background color width height, and center coordinate

Transparent 0, transparent 50px, #fff 50px, #fff 200%

The background color from the center to the circle is transparent, and the background color from the small circle to the big circle is #0cc

Related Article

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.