Style borderTopWidth Property
Przykład
Zmień szerokość górnej krawędzi elementu <div> na 10px:
document.getElementById("myDiv").style.borderTopWidth = "10px";
Definicja i użycie
Właściwość borderTopWidth ustawia lub zwraca szerokość górnej krawędzi elementu.
Obsługa przeglądarki
Property | |||||
---|---|---|---|---|---|
borderTopWidth | Yes | Yes | Yes | Yes | Yes |
Składnia
Zwróć właściwość borderTopWidth:
object.style.borderTopWidth
Ustaw właściwość borderTopWidth:
object.style.borderTopWidth = "thin|medium|thick|length|initial|inherit"
Wartości nieruchomości
Value | Description |
---|---|
thin | Defines a thin border |
medium | Defines a medium border. This is default |
thick | Defines a thick border |
length | The width of the border in length units |
inherit | The width of the top border is inherited from the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Szczegóły techniczne
Domyślna wartość: | średni |
---|---|
Wartość zwrotu: | String, reprezentujący szerokość górnej krawędzi elementu |
Wersja CSS | CSS1 |
Więcej przykładów
Przykład
Zmień szerokość górnej krawędzi elementu <div> na cienki:
document.getElementById("myDiv").style.borderTopWidth = "thin";
Przykład
Zwróć szerokość górnej krawędzi elementu <div>:
alert(document.getElementById("myDiv").style.borderTopWidth);
Powiązane strony
Samouczek CSS: obramowanie CSS
Odniesienie CSS: właściwość border-top-width
Odniesienie HTML DOM: border property
❮ Obiekt stylu