Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set Ellipse by css

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to set the ellipse in css". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to set the ellipse in css".

Css sets the ellipse method: 1, add "{width: width value; height: height value;}" style to the element, set the element to a rectangle; 2, add the "{border-radius:100%;}" fillet style to the rectangular element and set it to an ellipse.

The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.

The method of setting Ellipse by css

1. We can first create a rectangle for the div element, and then use the border-radius attribute class of css to set the rounded corners of the rectangle to get the ellipse. The code is as follows:

Create a rectangle first

Css makes the ellipse. Ellipse {width: 200pxposition height: 100pxposition background color: red;}

Output result:

2. Then use the border-radius property to set the fillet, and add: border-radius:100%; to the ellipse property to set the ellipse.

In order to be compatible with all kinds of browsers, we also need to add

-omurborderlue radiuslu 100% Matte msluborderlu radiuslu 100% Muzmur Muzmel radiuslu 100% Mustang webkitlyborderlyradiuslu 100%

The code is as follows:

Css makes the ellipse. Ellipse {width: 200pxposition height: 100pxposition background color: red;border-radius:100%;-o-border-radius:100%;-ms-border-radius:100%;-moz-border-radius:100%;-webkit-border-radius:100%;}

Output result:

Thank you for reading, the above is the content of "how to set the ellipse in css". After the study of this article, I believe you have a deeper understanding of how to set the ellipse in css, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report