Home Web Front-end CSS Tutorial Summary of how to use css3 rounded corners and rounded borders

Summary of how to use css3 rounded corners and rounded borders

Jun 05, 2017 am 11:06 AM

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 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

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

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to achieve wave effect with pure CSS3? (code example) How to achieve wave effect with pure CSS3? (code example) Jun 28, 2022 pm 01:39 PM

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!

Use CSS skillfully to realize various strange-shaped buttons (with code) Use CSS skillfully to realize various strange-shaped buttons (with code) Jul 19, 2022 am 11:28 AM

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!

Guide to modifying win11 window corners to rounded corners Guide to modifying win11 window corners to rounded corners Dec 31, 2023 pm 08:35 PM

After updating the win11 system, many friends found that the win11 interface window adopts a new rounded corner design. But some people don’t like this rounded corner design and want to modify it to the previous interface, but they don’t know how to modify it. Let’s take a look below. How to modify rounded corners in win11 1. The rounded corner design of win11 is a built-in system setting that cannot be modified at present. 2. So if you don’t like using the rounded corner design of win11, you can wait for Microsoft to provide a modification method. 3. If you are really not used to it, you can also choose to return to the previous win10 system. 4. If you don’t know how to roll back, you can check out the tutorials provided on this site. 5. If you cannot go back using the tutorial above, you can still

How to hide elements in css without taking up space How to hide elements in css without taking up space Jun 01, 2022 pm 07:15 PM

Two methods: 1. Using the display attribute, just add the "display:none;" style to the element. 2. Use the position and top attributes to set the absolute positioning of the element to hide the element. Just add the "position:absolute;top:-9999px;" style to the element.

How to implement lace borders in css3 How to implement lace borders in css3 Sep 16, 2022 pm 07:11 PM

In CSS, you can use the border-image attribute to achieve a lace border. The border-image attribute can use images to create borders, that is, add a background image to the border. You only need to specify the background image as a lace style; the syntax "border-image: url (image path) offsets the image border width inward. Whether outset is repeated;".

How to enlarge the image by clicking the mouse in css3 How to enlarge the image by clicking the mouse in css3 Apr 25, 2022 pm 04:52 PM

Implementation method: 1. Use the ":active" selector to select the state of the mouse click on the picture; 2. Use the transform attribute and scale() function to achieve the picture magnification effect, the syntax "img:active {transform: scale(x-axis magnification, y Axis magnification);}".

It turns out that text carousel and image carousel can also be realized using pure CSS! It turns out that text carousel and image carousel can also be realized using pure CSS! Jun 10, 2022 pm 01:00 PM

How to create text carousel and image carousel? The first thing everyone thinks of is whether to use js. In fact, text carousel and image carousel can also be realized using pure CSS. Let’s take a look at the implementation method. I hope it will be helpful to everyone!

How to set animation rotation speed in css3 How to set animation rotation speed in css3 Apr 28, 2022 pm 04:32 PM

In CSS3, you can use the "animation-timing-function" attribute to set the animation rotation speed. This attribute is used to specify how the animation will complete a cycle and set the speed curve of the animation. The syntax is "element {animation-timing-function: speed attribute value;}".

See all articles