Home > Web Front-end > CSS Tutorial > Use css3's radial-gradient to achieve a penetrating circle

Use css3's radial-gradient to achieve a penetrating circle

高洛峰
Release: 2016-10-15 16:47:39
Original
2477 people have browsed it

Look at the requirements first:

Use css3s radial-gradient to achieve a penetrating circle

As shown in the picture, you need to create this effect. How to usually do it? The semicircle cut into the picture can solve a situation where the background of the picture is fixed and not tiled.

If the background image is a tiled pattern, isn’t it fixed? The cut semicircle cannot correspond to the background image

Now you can use the radial gradient of css3 to realize this transparent circle. In this way, if the circle is transparent, you don’t have to worry about the background image

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

Code Explanation:

500px 500px at 50% 0px ,

The width and height of the background color of the white area, and the coordinates of the center of the circle

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

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


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template