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

วิธีสร้าง CSS3 มุมโค้งมน?


หากต้องการสร้างมุมโค้งมน ให้ใช้คุณสมบัติ border-radius ใน CSS3 ต่อไปนี้เป็นรหัสสำหรับสร้างมุมโค้งมน -

ตัวอย่าง

<!DOCTYPE html>
<html>
<head>
<style>
body {
   font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
div {
   display: inline-block;
   width: 200px;
   height: 200px;
   text-align: center;
   font-size: 30px;
}
.rounded {
   border-radius: 24px;
   border: 4px solid green;
}
.normal {
   border: 4px solid green;
   margin-left: 20px;
}
</style>
</head>
<body>
<h1>CSS3 rounded corner example</h1>
<div class="rounded">Rounded Corners</div>
<div class="normal">Default corners</div>
</body>
</html>

ผลลัพธ์

รหัสข้างต้นจะสร้างผลลัพธ์ต่อไปนี้ -

วิธีสร้าง CSS3 มุมโค้งมน?