خاصية CSS border-top-color
مثال
عيّن لونًا للحد العلوي:
div {border-top-color: coral;}
المزيد من الأمثلة "جربها بنفسك" أدناه.
التعريف والاستخدام
تعيّن border-top-color
الخاصية لون الحد العلوي للعنصر.
ملاحظة: قم دائمًا بتعريف نمط الحدود أو
خاصية نمط الحد العلوي قبل border-top-color
الخاصية. يجب أن يكون للعنصر حد قبل أن تتمكن من تغيير اللون.
القيمة الافتراضية: | اللون الحالي للعنصر |
---|---|
وارث: | رقم |
متحرك: | نعم. اقرأ عن animatable |
الإصدار: | CSS1 |
بناء جملة JavaScript: | الكائن .style.borderTopColor = "أزرق" |
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
Property | |||||
---|---|---|---|---|---|
border-top-color | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
بنية CSS
border-top-color: color|transparent|initial|inherit;
قيم الملكية
Value | Description | Play it |
---|---|---|
color | Specifies the color of the top border. Look at CSS Color Values for a complete list of possible color values. Default color is the current color of the element | |
transparent | Specifies that the border color should be transparent | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
مزيد من الأمثلة
مثال
عيّن لونًا للحد العلوي بقيمة HEX:
div {border-top-color: #92a8d1;}
مثال
عيّن لونًا للحد العلوي بقيمة RGB:
div {border-top-color: rgb(201, 76, 76);}
مثال
عيّن لونًا للحد العلوي بقيمة RGBA:
div {border-top-color: rgba(201, 76, 76, 0.3);}
مثال
عيّن لونًا للحد العلوي بقيمة HSL:
div {border-top-color: hsl(89, 43%, 51%);}
مثال
عيّن لونًا للحد العلوي بقيمة HSLA:
div {border-top-color: hsla(89, 43%, 51%, 0.3);}
مثال
تعيين حد علوي شفاف:
div {border-top-color: transparent;}
الصفحات ذات الصلة
دروس CSS: CSS Border
مرجع CSS: خاصية border-top
مرجع DOM HTML: خاصية borderTopColor