What is the CSS round corner (border-radius)?
CSS
border-radius
Properties draw round corners for the boundary outside the border of the element. Although it seems to be a simple visual modification, in modern web design, round corners can significantly reduce the "sweetness" of interfaces, allowing Ui looks more friendly, more modern. It addresses the specific issues of “too rigid interface” and “lack of kinship”.
General mode vs. Advanced 8 Point Mode
- General mode (Simple Mode): Corresponds to four angles. Each angle is defined by a radius, creating a perfect 1/4 circle. This is the most common round-angle application.
-
Advanced 8 Point Mode (Full Mode):
This is...
border-radiusAdvanced use of properties, allowing you to set horizontal and vertical radiuss for each angle (the syntax is:30% 70% 70% 30% / 30% 30% 70% 70%)。 In this way, you can create a very artistic "organism" or "blob" shape, which is very popular in the current creative web design.
How do you select the right round angle size?
The size of the round corners directly affects the user ' s perception of the interface:
- 2px - 4px: A tiny round corner that preserves the rectangle ' s sense of rigour while removing the sharpness. Suits enterprise-level backstage or serious text.
- 8px - 12px: Modern mainstream style. Fits to cards, buttons and dialogue boxes, which provide good visual comfort.
- 50%: Turns the square into a circle. is often used in the header or icon.
- Organic shape (Blob): Generates using advanced mode. Suits the vehicle for the background decoration or creative illustration.
Common issues (FAQ)
Q: Why did I set up 50%, but not the circle?
A: 50% only if the elements are fully equal in width (square form) And the round corners produce the perfect circle. If a rectangular is the case, an ellipse is generated.
Q: Will the corner cut the picture?
A: Yes, as long as you set the container.
overflow: hidden;
, the internal picture or content is trimmed by round shape.
Q: How is the compatibility of the 8-point mode?
A: The grammar has been used by all mainstream browsers since the CSS3 era (Chrome, Firefox, Safari, Zafari, Zafar) Edge) fully supports the idea that you can use it in the production environment.