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

时间:2026-02-13 13:16:25

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

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

2、创建圆的样式。在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%;

如图:

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

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

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

4、所有代码:

<!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>

© 2026 五度知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com