HTML | DOM Style borderLeftWidth Property Last Updated : 14 Jul, 2022 Comments Improve Suggest changes 1 Likes Like Report The DOM Style borderLeftWidth property is used to set or return the width of the left border of an element. Syntax: To get the borderLeftWidth Property object.style.borderLeftWidth To set the borderLeftWidth Property object.style.borderLeftWidth = "thin | medium | thick | length | initial | inherit" Return Values: It returns a string value, which representing the width of an element's left border. Property Values: thin: This is used to define a thin left border. Example-1: html <!DOCTYPE html> <html lang="en"> <head> <title> DOM Style BorderLeftWidth </title> <style> .elem { padding: 10px; border-style: solid; } </style> </head> <body> <h1 style="color: green"> GeeksforGeeks </h1> <b> DOM Style BorderLeftWidth </b> <p class="elem"> GeeksforGeeks is a computer science portal with a huge variety of well written and explained computer science and programming articles, quizzes and interview questions. </p> <button onclick="changeWidth()"> Change BorderLeftWidth </button> <!-- Script to change BorderLeftWidth --> <script> function changeWidth() { elem = document.querySelector('.elem'); elem.style.borderLeftWidth = 'thin'; } </script> </body> </html> Output: Before clicking the button: After clicking the button: medium: This is used to define a medium left border. This is the default value. Example-2: html <!DOCTYPE html> <html lang="en"> <head> <title> DOM Style BorderLeftWidth </title> <style> .elem { padding: 10px; border-style: solid; border-left-width: thin; } </style> </head> <body> <h1 style="color: green"> GeeksforGeeks </h1> <b> DOM Style BorderLeftWidth </b> <p class="elem"> GeeksforGeeks is a computer science portal with a huge variety of well written and explained computer science and programming articles, quizzes and interview questions. </p> <button onclick="changeWidth()"> Change BorderLeftWidth </button> <!-- Script to change BorderLeftWidth --> <script> function changeWidth() { elem = document.querySelector('.elem'); elem.style.borderLeftWidth = 'medium'; } </script> </body> </html> Output: Before clicking the button: After clicking the button: thick: This is used to define a thick left border. Example-3: html <!DOCTYPE html> <html lang="en"> <head> <title> DOM Style BorderLeftWidth </title> <style> .elem { padding: 10px; border-style: solid; } </style> </head> <body> <h1 style="color: green"> GeeksforGeeks </h1> <b> DOM Style BorderLeftWidth </b> <p class="elem"> GeeksforGeeks is a computer science portal with a huge variety of well written and explained computer science and programming articles, quizzes and interview questions. </p> <button onclick="changeWidth()"> Change BorderLeftWidth </button> <!-- Script to change BorderLeftWidth --> <script> function changeWidth() { elem = document.querySelector('.elem'); elem.style.borderLeftWidth = 'thick'; } </script> </body> </html> Output: Before clicking the button: After clicking the button: length: This is used to define the left border width in terms of length units. Example-4: html <!DOCTYPE html> <html lang="en"> <head> <title> DOM Style BorderLeftWidth </title> <style> .elem { padding: 10px; border-style: solid; } </style> </head> <body> <h1 style="color: green"> GeeksforGeeks </h1> <b> DOM Style BorderLeftWidth </b> <p class="elem"> GeeksforGeeks is a computer science portal with a huge variety of well written and explained computer science and programming articles, quizzes and interview questions. </p> <button onclick="changeWidth()"> Change BorderLeftWidth </button> <!-- Script to change BorderLeftWidth --> <script> function changeWidth() { elem = document.querySelector('.elem'); elem.style.borderLeftWidth = '10px'; } </script> </body> </html> Output: Before clicking the button: After clicking the button: initial: This is used to set this property to its default value. Example-5: html <!DOCTYPE html> <html lang="en"> <head> <title> DOM Style BorderLeftWidth </title> <style> .elem { padding: 10px; border-style: solid; border-left-width: 15px; } </style> </head> <body> <h1 style="color: green"> GeeksforGeeks </h1> <b> DOM Style BorderLeftWidth </b> <p class="elem"> GeeksforGeeks is a computer science portal with a huge variety of well written and explained computer science and programming articles, quizzes and interview questions. </p> <button onclick="changeWidth()"> Change BorderLeftWidth </button> <!-- Script to change BorderLeftWidth --> <script> function changeWidth() { elem = document.querySelector('.elem'); elem.style.borderLeftWidth = 'initial'; } </script> </body> </html> Output: Before clicking the button: After clicking the button: inherit: This inherits the property from its parent. Example-6: html <!DOCTYPE html> <html lang="en"> <head> <title> DOM Style BorderLeftWidth </title> <style> #parent { padding: 10px; border-style: solid; border-left-width: 15px; } .elem { padding: 10px; border-style: solid; } </style> </head> <body> <h1 style="color: green"> GeeksforGeeks </h1> <b> DOM Style BorderLeftWidth </b> <br> <br> <div id="parent"> <p class="elem"> GeeksforGeeks is a computer science portal with a huge variety of well written and explained computer science and programming articles, quizzes and interview questions. </p> </div> <br> <button onclick="changeWidth()"> Change BorderLeftWidth </button> <!-- Script to change BorderLeftWidth --> <script> function changeWidth() { elem = document.querySelector('.elem'); elem.style.borderLeftWidth = 'inherit'; } </script> </body> </html> Output: Before clicking the button: After clicking the button: Supported Browsers: The browser supported by borderLeftWidth property are listed below: Google Chrome 1 and above Edge 12 and above Internet Explorer 4 and above Firefox 1 and above Opera 3.5 and above Apple Safari 1 and above Create Quiz Comment S sayantanm19 Follow 1 Improve S sayantanm19 Follow 1 Improve Article Tags : Web Technologies HTML HTML-DOM Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms4 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like