ในการเพิ่มรูปภาพขอบใน CSS3 ให้ใช้คุณสมบัติ border-image ซึ่งเป็นคุณสมบัติแบบย่อสำหรับคุณสมบัติต่อไปนี้:
border-image-source border-image-slice border-image-width border-image-outset border-image-repeat
ค่าสามารถกำหนดได้ดังนี้:
border-image: source slice width outset repeat|initial|inherit;
ตัวอย่าง
ลองดูตัวอย่างต่อไปนี้:
<!DOCTYPE html> <html> <head> <style> #demo { border: 20px solid; padding: 20px; border-image: url(https://www.tutorialspoint.com/images/home_ai_python.png) 20 round; } </style> </head> <body> <h1>บทช่วยสอน PyTorch</h1> <p>PyTorch เป็นไลบรารีการเรียนรู้ของเครื่องโอเพนซอร์สสำหรับ Python และพัฒนาจาก Torch ทั้งหมด</p> <p id="demo">ใช้ 주로 สำหรับแอปพลิเคชันเช่น การประมวลผลภาษาธรรมชาติ</p> </body> </html>
ผลลัพธ์

ตัวอย่างเพิ่มเติม
ลองดูอีกตัวอย่างหนึ่ง:
<!DOCTYPE html> <html> <head> <style> #demo { border: 20px solid; padding: 20px; border-image: url(https://www.tutorialspoint.com/images/home_pytorch.png) 40% round; } </style> </head> <body> <h1>บทช่วยสอน TensorFlow</h1> <p>TensorFlow เป็นเฟรมเวิร์กการเรียนรู้ของเครื่องโอเพนซอร์สสำหรับนักพัฒนาทุกคน ใช้สำหรับการนำการเรียนรู้ของเครื่องและการเรียนรู้เชิงลึกไปใช้งาน</p> <p id="demo"> เพื่อพัฒนาและวิจัยไอเดียที่น่าสนใจเกี่ยวกับปัญญาประดิษฐ์ ทีม Google สร้าง TensorFlow ขึ้น</p> </body> </html>
ผลลัพธ์
