शैली सीमाशैली संपत्ति
उदाहरण
<div> तत्व में "ठोस" बॉर्डर जोड़ें:
document.getElementById("myDiv").style.borderStyle = "solid";
परिभाषा और उपयोग
सीमा शैली गुण किसी तत्व की सीमा की शैली को सेट या लौटाता है।
यह गुण एक से चार मान ले सकता है:
- एक मान, जैसे: p {बॉर्डर-स्टाइल: सॉलिड} - चारों बॉर्डर सॉलिड होंगे
- दो मान, जैसे: p {बॉर्डर-स्टाइल: सॉलिड डॉटेड} - ऊपर और नीचे का बॉर्डर सॉलिड होगा, लेफ्ट और राइट बॉर्डर डॉटेड होगा
- तीन मान, जैसे: p {बॉर्डर-स्टाइल: सॉलिड डॉटेड डबल}- टॉप बॉर्डर सॉलिड होगा, लेफ्ट और राइट बॉर्डर डॉटेड होगा, बॉटम बॉर्डर डबल होगा
- चार मान, जैसे: p {बॉर्डर-स्टाइल: सॉलिड डॉटेड डबल डैश्ड} - टॉप बॉर्डर सॉलिड होगा, राइट बॉर्डर डॉटेड होगा, बॉटम बॉर्डर डबल होगा, लेफ्ट बॉर्डर डैश्ड होगा
ब्राउज़र समर्थन
Property | |||||
---|---|---|---|---|---|
borderStyle | Yes | Yes | Yes | Yes | Yes |
वाक्य - विन्यास
सीमा शैली संपत्ति लौटाएं:
object.style.borderStyle
सीमा शैली संपत्ति सेट करें:
object.style.borderStyle = value
सम्पत्ति की कीमत
Value | Description |
---|---|
none | Defines no border. This is default |
hidden | The 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 |
टेक्निकल डिटेल
डिफ़ॉल्ट मान: | कोई नहीं |
---|---|
प्रतिलाभ की मात्रा: | एक स्ट्रिंग, एक तत्व की सीमा की शैली का प्रतिनिधित्व करता है |
सीएसएस संस्करण | सीएसएस 1 |
और ज्यादा उदाहरण
उदाहरण
<div> तत्व की चार सीमाओं की शैली बदलें:
document.getElementById("myDiv").style.borderStyle = "dotted solid double dashed";
उदाहरण
<div> तत्व की सीमा शैली लौटाएं:
alert(document.getElementById("myDiv").style.borderStyle);
उदाहरण
सभी विभिन्न मूल्यों का प्रदर्शन:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myDiv").style.borderStyle = listValue;
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस बॉर्डर
सीएसएस संदर्भ: सीमा-शैली की संपत्ति
एचटीएमएल डोम संदर्भ: सीमा संपत्ति
❮ स्टाइल ऑब्जेक्ट