คุณสมบัติ border-top

คุณสมบัติ border-top กำหนดสี ประเภท และความหนาสำหรับขอบด้านบน เป็นคุณสมบัติแบบย่อ สำหรับ border-top-width, border-top-style และ border-top-color

ไวยากรณ์

cssselector {
  border-top: thickness type color;
}

ลำดับของค่าคุณสมบัติไม่มีผล

ตัวอย่าง

มาใส่ขอบด้านบนสีดำให้กับองค์ประกอบ หนา 2px:

html<div id="elem"></div>
css#elem {
  border-top: 2px solid black;
  background: #f9f9f9;
  width: 300px;
  height: 100px;
}

Результат: