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

จะสร้างภาพที่โค้งมนและกลมด้วย CSS ได้อย่างไร?


ต่อไปนี้คือโค้ดสำหรับสร้างรูปภาพทรงกลมและวงกลมด้วย CSS -

ตัวอย่าง

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
img {
   border-radius: 50%;
   width: 300px;
   height: 300px;
}
</style>
</head>
<body>
<h1>Rounded Images Example</h1>
<img src="https://i.picsum.photos/id/271/400/400.jpg">
</body>
</html>

ผลลัพธ์

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

จะสร้างภาพที่โค้งมนและกลมด้วย CSS ได้อย่างไร?