HTML DOM | Style paddingRight Property Last Updated : 14 Jul, 2022 Comments Improve Suggest changes Like Article Like Report The Style paddingRight property is used for setting or returning the right padding of an element. The padding property inserts the user desired space within the border of an element. Syntax : To get the property:object.style.paddingRightTo set the property:object.style.paddingRight = "%|length|initial|inherit" Return Values: It returns a string value, which represents the right padding of an element Property Values: % : It is used to define the right padding in % of the width of the parent element.length : It is used to define the right padding in length units.initial : It is used to set this property to its default value.inherit : It is used to inherit this property from its parent element. Below program illustrates the Style paddingRight property method : Example: Setting the right padding of a <div> element. html <!DOCTYPE html> <html> <head> <title>Style paddingRight in HTML</title> <style> #MyElement { border: 1px solid black; background-color: green; width: 300px; height: 300px; } h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>Style paddingRight</h2> <p>For setting the right padding, double click the "Apply Right Padding" button: </p> <br> <button onClick="padding()">Apply Right Padding</button> <div id="MyElement"> Geeksforgeeks is a portal for geeks. </div> <script> function padding() { document.getElementById("MyElement") .style.paddingRight = "100px"; } </script> </body> </html> Output: Before Clicking the button: After clicking the button: Supported Browsers: The browser supported by HTML DOM | Style paddingRight Property are listed below: Google Chrome 1 and aboveEdge 12 and aboveInternet Explorer 4 and aboveFirefox 1 and aboveOpera 3.5 and aboveApple Safari 1 and above Create Quiz Comment S Shubrodeep Banerjee Follow 0 Improve S Shubrodeep Banerjee 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 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