Home>Article>Web Front-end> How to turn a square into a circle in css

How to turn a square into a circle in css

藏色散人
藏色散人 Original
2020-12-31 09:55:57 7571browse

How to turn a square into a circle in css: first create a new html sample file; then enter the div tag in the body tag, and add a class name to the div tag; finally, add the attribute "border- radius:150px" to turn the square into a circle.

How to turn a square into a circle in css

The operating environment of this tutorial: Dell G3 computer, Windows7 system, PhpStorm 2019.3.1 x64&&HTML5&&css3 version.

Recommended: "css video tutorial"

Create a new convert square into circle.html file, as shown in the picture:

How to turn a square into a circle in css

Enter the HTML5 structure code and modify the content in the title tag to: change the square into a circle, as shown in the picture:

How to turn a square into a circle in css

In Enter the div tag in the body tag, and add a class name (box) to the div tag, as shown in the figure:

How to turn a square into a circle in css

Add CSS attributes to the class name (box), let It becomes a square, as shown in the picture:

How to turn a square into a circle in css

##Add a CSS attribute, code: border-radius:150px, as shown in the picture:

How to turn a square into a circle in css

Run the web page and you can see that the square has turned into a circle, as shown in the picture:

How to turn a square into a circle in css

The above is the detailed content of How to turn a square into a circle in css. 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