Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

เปลี่ยนสีขอบบนด้วย CSS (border-top-color)


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

คุณสมบัติ border-top-color ใช้เปลี่ยนสีของขอบบน ลองรันโค้ดต่อไปนี้เพื่อนำ border-top-color property ไปใช้:

ตัวอย่าง

<html>
  <head>
    <style>
      p.demo {
        border: 3px solid;
        border-top-color: #FF0000;
      }
    </style>
  </head>
  <body>
    <p class="demo">
      Example showing border top color property </p>
  </body>
</html>

รายละเอียด:

  • ต้องมี border-style และ border-width ก่อน
  • รองรับรูปแบบสีทั้งหมด
  • ค่าเริ่มต้น: currentColor