Get the App
SLTechnology News&Howtos  ›  Development  › 

How to draw all kinds of ellipses with css3

Shulou Source: shulou.com Published: 2022-06-01 10:44:16 10月03日 Update

This article mainly introduces how to use css3 to draw a variety of ellipses, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

The principle of drawing all kinds of ellipses using css3

We need to use the border-radius property in css3, change the width value to 200px, and then change the border-radius to 100pxmax 50px; the horizontal radius before "/" and the vertical radius after "/", so 100px/50px makes div an elliptical border-radius:100px/50px

Now that we need to use the border-radius property in css3, today we will take a closer look at the border-radius property.

Border-radius attribute

Meaning: border-radius attribute shorthand attribute adds a fillet border to the element.

Syntax: border-radius:1-4length |% / 1-4length |%

Browser compatibility: IE9+, Firefox4+, Chrome, Safari5+, and Opera support the border-radius attribute.

Use css3 to draw all kinds of ellipse code

Rookie course (runoob.com)

# rcorners1 {

Border-radius:50px/15px

Background:#8AC007

Padding:20px

Width:200px

Height:150px

}

# rcorners2 {

Border-radius:15px/50px

Background:#8AC007

Padding:20px

Width:200px

Height:150px

}

# rcorners3 {

Border-radius:50%

Background:#8AC007

Padding:20px

Width:200px

Height:150px

}

Thank you for reading this article carefully. I hope the article "how to draw all kinds of ellipses with css3" shared by the editor will be helpful to everyone. At the same time, I also hope you can support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Attributes ellipses various types articles radius support code values elements interests compatibility principles at the same time meaning fillets tutorials more friends levels browsers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Technology OPPO Reno MariaDB Microsoft