คุณสมบัติ border-top
คุณสมบัติ border-top กำหนดสี ประเภท
และความหนาสำหรับขอบด้านบน เป็นคุณสมบัติแบบย่อ
สำหรับ border-top-width,
border-top-style
และ border-top-color
ไวยากรณ์
selector {
border-top: thickness type color;
}
ลำดับของค่าคุณสมบัติไม่มีผล
ตัวอย่าง
มาใส่ขอบด้านบนสีดำให้กับองค์ประกอบ
หนา 2px:
<div id="elem"></div>
#elem {
border-top: 2px solid black;
background: #f9f9f9;
width: 300px;
height: 100px;
}
: