


Share an article using CSS3 to achieve concave rounded corners effect code
This article mainly introduces the example code for realizing concave rounded corners in CSS3. The editor thinks it is quite good. Now I will share it with you and give it as a reference. Let’s follow the editor and take a look.
Filleting, everyone must be able to do it, border-radius, how to achieve concave rounded corners?
You can use a white round box to cover most of the square box, but this is opaque. When the background changes, you have to change the color of the covering box, or the background is a gradient, which is more troublesome to change. , or the background is a picture, etc., it is simply not easy to change. This method has limitations. To put it bluntly, after the covered part is opaque, the adaptability is not strong.
Here is a concave fillet implemented using radial gradient, which can solve the above problems. You can use CSS to generate a concave fillet with a transparent background.
1. Basic linear gradient
p { height:100px; width:200px; background-image:linear-gradient(90deg,red,blue); } <p>从左到右的红到蓝渐变</p>
2. Add percentage to adjust the gradient range
p { height:100px; width:200px; background-image:linear-gradient(90deg,red 20%,blue 80%); } <p></p>
3. Condensation The gradient range until they overlap to form two color blocks separated by red and blue
p { height:100px; width:200px; background-image:linear-gradient(90deg,red 50%,blue 50%); } <p></p>
4. The color can be set to transparent color, transparent, change red to transparent color, you can see There are only blue color blocks.
p { height:100px; width:200px; background-image:linear-gradient(90deg,transparent 50%,blue 50%); } <p></p>
5. Think of the radial gradient in the same way, also shrink the gradient circle until it overlaps, and set the color near the center of the circle to transparent.
/* 径向渐变主体 */ .raidal { height:100px; width:100px; background:radial-gradient(transparent 50%,blue 50%); } <p class='raidal'></p>
6. The radial gradient can set the center position of the radius circle, so set it to the left top corner, adjust the radius size left top to 200px, and you will find a concave rounded corner with a transparent background Achieved.
When applying, you can use pseudo elements to set, then use absolute positioning, adjust the position of the child and the parent, and combine it into the desired effect
/* 径向渐变主体 */ .raidal1 { height:100px; width:100px; background:radial-gradient(200px at left top,transparent 50%,blue 50%); } <p class='raidal1'></p>
7. Similarly In the four directions, just adjust the center position of the circle
/* 左上 */ .raidal1 { height:100px; width:100px; background:radial-gradient(200px at left top,transparent 50%,blue 50%); } /* 右上 */ .raidal2 { height:100px; width:100px; background:radial-gradient(200px at right top,transparent 50%,blue 50%); } /* 右下 */ .raidal3 { height:100px; width:100px; background:radial-gradient(200px at right bottom,transparent 50%,blue 50%); } /* 左下 */ .raidal4 { height:100px; width:100px; background:radial-gradient(200px at left bottom,transparent 50%,blue 50%); } <p class='raidal1'></p> <p class='raidal2'></p> <p class='raidal3'></p> <p class='raidal4'></p>
8. Similarly, if you don’t want to have such rounded corners, you can also make an ellipse. Set two parameters for the radius, which is an ellipse.
/* 左上 */ .ellipse { height:100px; width:100px; background:radial-gradient(200px 300px at left top,transparent 50%,blue 50%); } <p class='ellipse'></p>
The radial gradient has many parameters that you can try to adjust yourself. Various strange shapes can appear, which will not be demonstrated here. Relatively speaking, concave rounded corners are enough
[Related recommendations]
1. Free css online video tutorial
3. php.cn Dugu Jiujian (2)-css video tutorial
The above is the detailed content of Share an article using CSS3 to achieve concave rounded corners effect code. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



You may have encountered the problem of green lines appearing on the screen of your smartphone. Even if you have never seen it, you must have seen related pictures on the Internet. So, have you ever encountered a situation where the smart watch screen turns white? On April 2, CNMO learned from foreign media that a Reddit user shared a picture on the social platform, showing the screen of the Samsung Watch series smart watches turning white. The user wrote: "I was charging when I left, and when I came back, it was like this. I tried to restart, but the screen was still like this during the restart process." Samsung Watch smart watch screen turned white. The Reddit user did not specify the smart watch. Specific model. However, judging from the picture, it should be Samsung Watch5. Previously, another Reddit user also reported

How to achieve wave effect with pure CSS3? This article will introduce to you how to use SVG and CSS animation to create wave effects. I hope it will be helpful to you!

Speaking of ASSASSIN, I believe players will definitely think of the master assassins in "Assassin's Creed". They are not only skilled, but also have the creed of "devoting themselves to the darkness and serving the light". The ASSASSIN series of flagship air-cooled radiators from the appliance brand DeepCool coincide with each other. Recently, the latest product of this series, ASSASSIN4S, has been launched. "Assassin in Suit, Advanced" brings a new air-cooling experience to advanced players. The appearance is full of details. The Assassin 4S radiator adopts a double tower structure + a single fan built-in design. The outside is covered with a cube-shaped fairing, which has a strong overall sense. It is available in white and black colors to meet different colors. Tie

This article will show you how to use CSS to easily realize various weird-shaped buttons that appear frequently. I hope it will be helpful to you!

With the arrival of spring, everything revives and everything is full of vitality and vitality. In this beautiful season, how to add a touch of color to your home life? Haqu H2 projector, with its exquisite design and super cost-effectiveness, has become an indispensable beauty in this spring. This H2 projector is compact yet stylish. Whether placed on the TV cabinet in the living room or next to the bedside table in the bedroom, it can become a beautiful landscape. Its body is made of milky white matte texture. This design not only makes the projector look more advanced, but also increases the comfort of the touch. The beige leather-like material adds a touch of warmth and elegance to the overall appearance. This combination of colors and materials not only conforms to the aesthetic trend of modern homes, but also can be integrated into

With its compact size, the ITX platform has attracted many players who pursue the ultimate and unique beauty. With the improvement of manufacturing processes and technological advancements, both Intel's 14th generation Core and RTX40 series graphics cards can exert their strength on the ITX platform, and gamers also There are higher requirements for SFX power supply. Game enthusiast Huntkey has launched a new MX series power supply. In the ITX platform that meets high-performance requirements, the MX750P full-module power supply has a rated power of up to 750W and has passed 80PLUS platinum level certification. Below we bring the evaluation of this power supply. Huntkey MX750P full-module power supply adopts a simple and fashionable design concept. There are two black and white models for players to choose from. Both use matte surface treatment and have a good texture with silver gray and red fonts.

A large model that can automatically analyze the content of PDFs, web pages, posters, and Excel charts is not too convenient for workers. The InternLM-XComposer2-4KHD (abbreviated as IXC2-4KHD) model proposed by Shanghai AILab, the Chinese University of Hong Kong and other research institutions makes this a reality. Compared with other multi-modal large models that have a resolution limit of no more than 1500x1500, this work increases the maximum input image of multi-modal large models to more than 4K (3840x1600) resolution, and supports any aspect ratio and 336 pixels to 4K Dynamic resolution changes. Three days after its release, the model topped the HuggingFace visual question answering model popularity list. Easy to handle

In the current era of rapid technological development, laptops have become an indispensable and important tool in people's daily life and work. For those players who have high performance requirements, a laptop with powerful configuration and excellent performance can meet their hard-core needs. With its excellent performance and stunning design, the Colorful Hidden Star P15 notebook computer has become the leader of the future and can be called a model of hard-core notebooks. Colorful Hidden Star P1524 is equipped with a 13th generation Intel Core i7 processor and RTX4060Laptop GPU. It adopts a more fashionable spaceship design style and has excellent performance in details. Let us first take a look at the features of this notebook. Supreme equipped with Intel Core i7-13620H processing
