نمط الخاصية borderTopStyle
مثال
أضف حدًا علويًا "متصلًا" إلى عنصر <div>:
document.getElementById("myDiv").style.borderTopStyle = "solid";
التعريف والاستخدام
تقوم الخاصية borderTopStyle بتعيين أو إرجاع نمط الحد العلوي لعنصر ما.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
borderTopStyle | Yes | Yes | Yes | Yes | Yes |
بناء الجملة
قم بإرجاع خاصية borderTopStyle:
object.style.borderTopStyle
قم بتعيين خاصية borderTopStyle:
object.style.borderTopStyle = value
|initial|inherit
قيم الملكية
Value | Description |
---|---|
none | Defines no border. This is default |
hidden | Same as "none", except in border conflict resolution for table elements |
dotted | Defines a dotted border |
dashed | Defines a dashed border |
solid | Defines a solid border |
double | Defines two borders. The width of the two borders are the same as the border-width value |
groove | Defines a 3D grooved border. The effect depends on the border-color value |
ridge | Defines a 3D ridged border. The effect depends on the border-color value |
inset | Defines a 3D inset border. The effect depends on the border-color value |
outset | Defines a 3D outset border. The effect depends on the border-color value |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
تفاصيل تقنية
القيمة الافتراضية: | لا أحد |
---|---|
قيمة الإرجاع: | سلسلة ، تمثل نمط الحد العلوي للعنصر |
إصدار CSS | CSS1 |
مزيد من الأمثلة
مثال
غيّر نمط الحد العلوي لعنصر <div> إلى "منقط":
document.getElementById("myDiv").style.borderTopStyle = "dotted";
مثال
إرجاع نمط الحد العلوي لعنصر <div>:
alert(document.getElementById("myDiv").style.borderTopStyle);
مثال
عرض لجميع القيم المختلفة:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myDiv").style.borderTopStyle = listValue;
الصفحات ذات الصلة
دروس CSS: CSS Border
مرجع CSS: خاصية نمط الحد الأعلى
مرجع DOM HTML: خاصية الحدود
❮ نمط الكائن