Style borderTopWidth property
- Pagina precedente borderTopStyle
- Pagina successiva borderWidth
- Torna alla pagina precedente Oggetto Style HTML DOM
Definition and usage
borderTopWidth
Sets or returns the width of the element's border.
See also:
CSS Tutorial:Bordo CSS
CSS Reference Manual:border-top-width property
HTML DOM Reference Manual:border property
Example
Example 1
Change the top border width of the <div> element to 10px:
document.getElementById("myDiv").style.borderTopWidth = "10px";
Example 2
Change the top border width of the <div> element to thin:
document.getElementById("myDiv").style.borderTopWidth = "thin";
Example 3
Returns the width of the top border of the <div> element:
alert(document.getElementById("myDiv").style.borderTopWidth);
Syntax
Returns borderTopWidth property:
object.style.borderTopWidth
Sets borderTopWidth property:
object.style.borderTopWidth = "thin|medium|thick|length|initial|inherit"
Value | Description |
---|---|
thin | Defines thin borders. |
medium | Defines medium borders. Default. |
thick | Defines thick borders. |
length | Border width measured in length. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical details
Default value: | medium |
---|---|
Return value: | A string that represents the width of the element's top border. |
CSS version: | CSS1 |
browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supporto | Supporto | Supporto | Supporto | Supporto |
- Pagina precedente borderTopStyle
- Pagina successiva borderWidth
- Torna alla pagina precedente Oggetto Style HTML DOM