Style borderTopWidth Property

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP







<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->




Style borderTopWidth Property


❮ Style Object



Example


Change the width of the top border of a <div> element to 10px:



document.getElementById("myDiv").style.borderTopWidth = "10px";

Try it Yourself »


Definition and Usage



The borderTopWidth property sets or returns the width of the top border of
an element.



Browser Support














Property
borderTopWidth Yes Yes Yes Yes Yes

Syntax


Return the borderTopWidth property:



object.style.borderTopWidth

Set the borderTopWidth property:



object.style.borderTopWidth = "thin|medium|thick|length|initial|inherit"

Property Values


















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




<!--
mid_content, all: [300,250][336,280][728,90][970,250][970,90][320,50][468,60]
-->




Technical Details








Default Value: medium 
Return Value: A String, representing the width of an element's top border
CSS Version CSS1

More Examples



Example


Change the width of the top border of a <div> element to thin:



document.getElementById("myDiv").style.borderTopWidth = "thin";

Try it Yourself »



Example


Return the width of the top border of a <div> element:



alert(document.getElementById("myDiv").style.borderTopWidth);

Try it Yourself »


Related Pages


CSS tutorial: CSS Border


CSS reference: border-top-width property


HTML DOM reference: border property




❮ Style Object

Popular posts from this blog

Malaysia to Papua New Guinea by motorcycle?

.name

List of Bhojpuri films