如何在 HTML 页面中绘制圆形?

htmlweb developmentfront end technology更新于 2025/7/26 23:40:17

要在 HTML 页面中绘制圆形,请使用 SVG 或 Canvas。您也可以使用 CSS 的 border-radius 属性来绘制圆形。

示例

您可以尝试运行以下代码来学习如何在 HTML 中绘制圆形

<!DOCTYPE html>
<html>
   <head>
      <style>
         #circle {
            width: 50px;
            height: 50px;
            -webkit-border-radius: 25px;
            -moz-border-radius: 25px;
            border-radius: 25px;
            background: blue;
         }
      </style>
   <head>
   <body>
      <div id="circle"></div>
   </body>
</html>

相关文章


有用资源