Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

วิธีสร้างวงกลมว่าง (Empty Circles) ด้วย CSS


ในการสร้างวงกลมว่าง (Empty Circles) ด้วย CSS โค้ดมีดังนี้ −

ตัวอย่าง

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;       margin: 20px;    }    .circle {       height: 25px;       width: 25px;       background-color: rgb(52, 15, 138);       border-radius: 50%;       display: inline-block;    }    div :nth-of-type(2n) {       background-color: red;    } </style> </head> <body> <h1>Round dots example</h1> <div> <span class="circle"></span> <span class="circle"></span> <span class="circle"></span> <span class="circle"></span> </div> </body> </html>

ผลลัพธ์

โค้ดด้านบนจะแสดงผลดังนี้ −

วิธีสร้างวงกลมว่าง (Empty Circles) ด้วย CSS