css制作圆;css如何画圆;css如何制作圆形

作者:活力源 | 创建时间: 2023-05-23
css越来越强大了,你怎么css可以制作圆形吗,让我们一起来看看css如何制作圆形。...
css制作圆;css如何画圆;css如何制作圆形

操作方法

新建一个html页面,然后在页面上添加div标签。如图:

创建圆的样式。在title标签下新建一个<style type="text/css"></style>标签,然后在标签内容新建一个circle类,在circle类设置内容为: width: 100px;      height: 100px;      background-color:red;      border-radius: 50%;      -moz-border-radius: 50%;      -webkit-border-radius: 50%; 如图:

使用浏览器查看效果。把html文件保存后,使用浏览器打开就可以看到圆的效果了。如图:

所有代码: <!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>圆</title> <style type="text/css">  .circle{    width: 100px;      height: 100px;      background-color:red;      border-radius: 50%;      -moz-border-radius: 50%;      -webkit-border-radius: 50%;    } </style></head><body> <div class="circle"></div></body></html>

温馨提示

把步骤四的代码粘贴到html文件即可看到效果
点击展开全文

更多推荐