如何在 HTML 頁面中繪製圓圈?
若要在 HTML 頁面中繪製一個圓圈,可以使用 SVG 或畫布。你還可以使用 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>
廣告