Style borderWidth Property

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








googletag.cmd.push(function() googletag.display('div-gpt-ad-1422003450156-2'); );




Style borderWidth Property


❮ Style Object



Example


Change the width of the four borders of a <div> element:



document.getElementById("myDiv").style.borderWidth = "thick";

Try it Yourself »


Definition and Usage



The borderWidth property sets or returns the width of an element's border.


This property can take from one to four values:


  • One value, like: p border-width: thick - all four borders will be thick

  • Two values, like: p border-width: thick thin - the top and bottom border will be thick, left and right border will be thin

  • Three values, like: p border-width: thick thin medium- the top border will be thick, left and right border will be thin, bottom border will be medium

  • Four values, like: p border-width: thick thin medium 10px - the top border will be thick, right border will be thin, bottom border will be medium, left border will be 10px


Browser Support














Property
borderWidth Yes Yes Yes Yes Yes

Syntax


Return the borderWidth property:



object.style.borderWidth

Set the borderWidth property:



object.style.borderWidth = "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
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit






googletag.cmd.push(function() googletag.display('div-gpt-ad-1493883843099-0'); );





Technical Details








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

More Examples



Example


Change the width of the top and bottom border to thick, and the left and
right border to thin of a <div> element:



document.getElementById("myDiv").style.borderWidth = "thick thin";

Try it Yourself »



Example


Change the width of the four borders of a <div> element, using the length
value:



document.getElementById("myDiv").style.borderWidth = "1px 5px 10px 20px";

Try it Yourself »



Example


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



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

Try it Yourself »


Related Pages


CSS tutorial: CSS Border


CSS reference: border-width property


HTML DOM reference: border property




❮ Style Object

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

How do I collapse sections of code in Visual Studio Code for Windows?

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ