คุณสมบัติ borderBottom ใช้สำหรับการตั้งค่าหรือรับคุณสมบัติขอบด้านล่าง คุณสมบัติ border-bottom เป็นตัวย่อสำหรับ border-bottom-width, border-bottom-style, border-bottom-color
ไวยากรณ์
ต่อไปนี้เป็นไวยากรณ์สำหรับ −
การตั้งค่าคุณสมบัติ borderBottom -
object.style.borderBottom = "width style color|initial|inherit"
คุณค่า
ต่อไปนี้เป็นค่าคุณสมบัติข้างต้น -
| Sr.No | พารามิเตอร์ &คำอธิบาย |
|---|---|
| 1 | ความกว้าง สำหรับกำหนดความกว้างขอบด้านล่าง |
| 2 | สไตล์ สำหรับกำหนดลักษณะเส้นขอบด้านล่าง |
| 3 | สี สำหรับกำหนดสีขอบล่าง |
| 4 | เริ่มต้น สำหรับการตั้งค่าคุณสมบัตินี้เป็นค่าเริ่มต้น |
| 5 | สืบทอด เพื่อสืบทอดค่าคุณสมบัติหลัก |
ตัวอย่าง
เรามาดูตัวอย่างคุณสมบัติ borderBottom กัน −
<!DOCTYPE html>
<html>
<head>
<style>
#IMG1 {
border-bottom: 7px solid orange;
box-shadow: 2px 2px 4px 1px seagreen;
}
</style>
<script>
function changeBorder(){
document.getElementById("IMG1").style.borderBottom="10px dotted pink";
document.getElementById("Sample").innerHTML="The bottom border for the image is now changed";
}
</script>
</head>
<body>
<h2>Kotlin Tutorial</h2>
<img id="IMG1" src="https://www.tutorialspoint.com/kotlin/images/kotlin.jpg">
<p>Change the above image below border by clicking the below button</p>
<button onclick="changeBorder()">Change Bottom Border</button>
<p id="Sample"></p>
</body>
</html> ผลลัพธ์
สิ่งนี้จะสร้างผลลัพธ์ต่อไปนี้ -

เมื่อคลิกปุ่ม "เปลี่ยนขอบด้านล่าง" -
