search
HomeWeb Front-endCSS TutorialSummary of how to use css3 rounded corners and rounded borders

Before the advent of CSS3, the effect of rounded corners could be achieved through pictures or margin attributes. The traditional rounded corner generation scheme required multiple pictures as background patterns. After the emergence of CSS3, there is no need to waste time creating multiple images, which greatly reduces the workload, improves the performance of web pages, improves page loading speed, and increases visual reliability. Now that we have said that rounded corners in CSS3 have so many advantages, let’s summarize how to use CSS3 rounded corners and rounded borders.


#You can first learn "Quick CSS3 Rounded Corners Introduction Chapter Course

Summary of how to use css3 rounded corners and rounded borders

Knowledge related to the use of CSS3 rounded corners and rounded borders

1.

css3 fillet introduction and application skillsAdaptive ellipse and fillet construction,

To construct a circle on css, you only need to add border- The radius attribute value can be set to half the side length. Here we give a comprehensive introduction to the properties of border-radius. Border-radius is an abbreviated property. Its expansion formula is border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border- bottom-left-radius. It also has a little-known feature: border-radius can specify the horizontal and vertical radii separately, as long as the two values ​​​​are separated by a slash ( / ) (the horizontal and vertical radii of rounded corners are equal and can be combined) . Combining these characteristics, the detailed expansion of border-radius:50%; should be border-radius:50% 50% 50% 50%/50% 50% 50% 50%.

2. CSS3 rounded border and border image effect example sharingThe learning points are as follows:Rounded corner border-radius;

Box shadow box-shadow;Border image border-image. The border-radius property allows you to add rounded borders to your elements! The border-image property is used to set the border of the image. 3. Share an example code of CSS3 rounded corners and gradient function

Linear gradient: background: linear-gradient (set gradient form, first starting point of a color, the position of the middle color point, the end point color); Linear: type of gradient (linear gradient); form of gradient: optional parameters in two ways - 1. Set the rotation angle, 0 degrees represents the horizontal angle from From left to right, 90 degrees means from top to bottom, starting from 0 degrees and changing counterclockwise.

4.

Use of CSS3 rounded borders-Escape Tornado

border-radius detailed explanation

border-radius:50px;

上Bottom right, left, horizontal and vertical distance are 50px

border-radius:50%; The % sign here is the base length and width of the applied CSS style element

border-radius:50% 30%; Up and down, horizontal and vertical is about 50%, horizontal and vertical is 30%

border-radius:50% 30% 10%; Up, horizontal and vertical is 50%, left and right, horizontal Vertical is 30%, bottom, horizontal and vertical is 10%

border-radius:10% 50% 30% 10%; Up, horizontal and vertical are both 10%. Right, horizontal and vertical are both 50%. Down, horizontally and vertically are 30%. Left, horizontal and vertical are both 10% /The front is horizontal,/the back is vertical

border-radius:50% / 30%; Up, left, bottom, right , horizontal is 50%, vertical is 30%

border-radius:50% / 30% 10%; Left and right vertical 10%;

5.

CSS3 rounded corners, shadow, transparent

There are two ways to achieve rounded corners in CSS3.

The first is the background image. Traditional CSS can only have one background image for each element, but CSS3 can allow one element to have multiple background images. In this way, four 1/4 circle background images are added to an element, located at 4 You can achieve rounded corners on a single corner.

The second method is simple and can be implemented directly with CSS without using pictures.

6.

css3 rounded border production Method

Firefox and Safari use private properties to achieve the rounded corner effect; This represents the color of the bottom image in the border; border: 1px solid #000; represents the width of the border, solid, and the color is black; border-top-left-radius: 55px 25px; indicates the border rounded effect in the upper left corner, which can be identified in English: top, left. The length of the modified rounded corners is achieved by controlling the pixel value. 55px indicates the horizontal length, and 25px indicates Vertical length; Similarly, border-bottom-right-radius: 55px 25px; for the rounded corner effect in the lower right corner, just change top to bottom; use css3 to achieve the border rounded corner effect.

Related Questions and Answers

1.

css3 rounded border-radius creates sharp corners.

2.

WeChat browser css3 rounded corners problem

3.

css3 rounded rectangle problem

【 Related recommendations]

1. PHP Chinese website free video tutorial:

CSS3 latest video tutorial

2. PHP Chinese website free tutorial:

CSS3 latest basic tutorial detailed explanation



The above is the detailed content of Summary of how to use css3 rounded corners and rounded borders. For more information, please follow other related articles on the PHP Chinese website!

Statement
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
Draggin' and Droppin' in ReactDraggin' and Droppin' in ReactApr 17, 2025 am 11:52 AM

The React ecosystem offers us a lot of libraries that all are focused on the interaction of drag and drop. We have react-dnd, react-beautiful-dnd,

Fast SoftwareFast SoftwareApr 17, 2025 am 11:49 AM

There have been some wonderfully interconnected things about fast software lately.

Nested Gradients with background-clipNested Gradients with background-clipApr 17, 2025 am 11:47 AM

I can't say I use background-clip all that often. I'd wager it's hardly ever used in day-to-day CSS work. But I was reminded of it in a post by Stefan Judis,

Using requestAnimationFrame with React HooksUsing requestAnimationFrame with React HooksApr 17, 2025 am 11:46 AM

Animating with requestAnimationFrame should be easy, but if you haven’t read React’s documentation thoroughly then you will probably run into a few things

Need to scroll to the top of the page?Need to scroll to the top of the page?Apr 17, 2025 am 11:45 AM

Perhaps the easiest way to offer that to the user is a link that targets an ID on the element. So like...

The Best (GraphQL) API is One You WriteThe Best (GraphQL) API is One You WriteApr 17, 2025 am 11:36 AM

Listen, I am no GraphQL expert but I do enjoy working with it. The way it exposes data to me as a front-end developer is pretty cool. It's like a menu of

Weekly Platform News: Text Spacing Bookmarklet, Top-Level Await, New AMP Loading IndicatorWeekly Platform News: Text Spacing Bookmarklet, Top-Level Await, New AMP Loading IndicatorApr 17, 2025 am 11:26 AM

In this week's roundup, a handy bookmarklet for inspecting typography, using await to tinker with how JavaScript modules import one another, plus Facebook's

Various Methods for Expanding a Box While Preserving the Border RadiusVarious Methods for Expanding a Box While Preserving the Border RadiusApr 17, 2025 am 11:19 AM

I've recently noticed an interesting change on CodePen: on hovering the pens on the homepage, there's a rectangle with rounded corners expanding in the back.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft