HTML DOM Style paddingLeft Property Last Updated : 29 Jan, 2024 Comments Improve Suggest changes Like Article Like Report The Style paddingLeft property in HTML DOM is used to set or return the left padding of the element. Syntax: It returns the paddingLeft property. object.style.paddingLeftIt sets the paddingLeft Property. object.style.paddingLeft = "% | length | initial | inherit"Return value: It returns the string value that represents the left padding of an element. Example 1: This example changes the paddingLeft property of an element. html <!DOCTYPE html> <html> <head> <title>HTML DOM Style paddingLeft Property</title> <style> body { text-align: center; } #textContent { border: 1px solid black; width: 300px; margin: auto; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML DOM Style paddingLeft Property</h2> <p id="textContent"> A computer science portal for geeks </p> <br> <button onClick="myGeeks()"> Change Left Padding </button> <script> function myGeeks() { // Set padding left using // length unit. document.getElementById("textContent") .style.paddingLeft = "50px"; } </script> </body> </html> Output: Example 2: This example changes the paddingLeft property of an element. html <!DOCTYPE html> <html> <head> <title>HTML DOM Style paddingLeft Property</title> <style> body { text-align: center; } #textContent { border: 1px solid black; width: 300px; margin: auto; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML DOM Style paddingLeft Property</h2> <p id="textContent"> A computer science portal for geeks </p> <br> <button onClick="myGeeks()"> Change Left Padding </button> <script> function myGeeks() { // Set padding left using // length unit. document.getElementById("textContent") .style.paddingLeft = "10%"; } </script> </body> </html> Output: Supported Browsers: Chrome 1Edge 12Firefox 1Safari 1Opera 3.5 Create Quiz Comment P PranchalKatiyar Follow 0 Improve P PranchalKatiyar Follow 0 Improve Article Tags : Web Technologies HTML HTML-DOM HTML-Property 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 Forms5 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 List15+ 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