Get the App
SLTechnology News&Howtos  ›  Development  › 

How to draw the right semicircle by css

Shulou Source: shulou.com Published: 2022-06-02 07:53:31 10月02日 Update

This article mainly introduces css how to draw the right semicircle, 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.

Method: 1, add "width: width value; height: height value;" style, set the element to a rectangle whose width is half the height; 2, add "border-radius:0 rectangle width value rectangle width value 0;" style, set fillet to the rectangle, and then set the rectangle to the right semicircle style.

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

How does css draw the right semicircle?

In css, you can first create a rectangular element whose width is half the height, as shown in the following example:

Document div {width: 50pxposition height: 100pxposition backgroundcolor pigment red;}

Output result:

Then use the border-radius property to set the fillet style on the right, setting the fillet value as large as the width value. Examples are as follows:

Document div {width: 50px: height: 100px; 50px 50px: 0px;}

Output result:

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

Tags: Width rectangle semicircle element style article fillet height example result output value interest right simultaneously properties tutorials methods more friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Information Linux Huawei MySQL