HTML | DOM Style left Property Last Updated : 08 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The Style left property is used for setting or returning the left position of a positioned element. The Style left property is used for specifying the left position of the elements including padding, scrollbar, border, and margin. Syntax : To get the property:object.style.leftTo set the propertyobject.style.left = "auto|length|%|initial|inherit" Return Values: It returns a string value, which represents the left position of a positioned element. Property Values: auto: This value automatically sets the default left value by the browser.length: This value sets the left value in the specified length units. This specified length can be positive as well as negative.%: Percentage value sets the left value in the specified percentage of the parent element's width.initial: This value sets the left property to its browser's default value.inherit: This value sets the left property to the value from its parent element. Example: Setting the left position of a <button> element. html <!DOCTYPE html> <html> <head> <title>Style left Property Method in HTML</title> <style> #MyButton { position: absolute; } h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body onclick="MyEvent(event)"> <h1>GeeksforGeeks</h1> <h2>Style left Property Method</h2> <p>For moving the button to its left, double click the "Move Left" button: </p> <button type="button" id="MyButton" ondblclick="left()"> Move Left </button> <script> function left() { /* The left property is defined with length value. Similarly other values also can be defined for this property. */ document.getElementById("MyButton") .style.left = "100px"; } </script> </body> </html> Output: Before clicking the button: After clicking the button: Supported Browsers: The browser supported by HTML | DOM Style left Property are listed below: Google Chrome 1Edge 12Internet Explorer 5.5Firefox 1Apple Safari 1Opera 5 Comment More infoAdvertise with us S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM HTML-Property Similar Reads HTML | DOM Style marginLeft Property The DOM Style marginLeft property is used to set or get the left margin of an element. The margin is used to insert space around the border, unlike padding that is used to insert space within the border of an element. Syntax: To Set the marginLeft:object.style.marginLeft='%|length|auto|initial|inher 2 min read HTML DOM MouseEvent The MouseEvent Object handles events that occur when the mouse interacts with the HTML document. There are lots of events that interacts with the HTML document. Mouse Events: Mouse events are the action taken by the user on the web page, like clicking, hovering over, etc. Mouse Events Description on 3 min read HTML DOM Style fontWeight Property The fontWeight style property in HTML DOM is used to set or return the thickness of characters in a word that should appear. Syntax: It returns the fontWeight property.object.style.fontWeightIt sets the fontWeight Property.object.style.fontWeight = "normal | lighter | bold | bolder | value | initial 2 min read HTML | DOM Pre Object The DOM Pre Object is used to represent the HTML <pre> element. The pre element is accessed by getElementById().Properties: width: It is used to set or return the value of the width attribute of the pre element. Syntax: document.getElementById("ID"); Where âidâ is the ID assigned to the âpreâ 1 min read HTML | DOM Ol Object The DOM Ol Object is used to represent the HTML <ol> element . The ol element is accessed by getElementById(). To read more about lists check HTML | Lists. Properties: compact: It is used to set or return whether the size of the list would be displayed normal or not.reversed: It is used to set 2 min read HTML | DOM Style letterSpacing Property The Style letterSpacing property in HTML DOM is used to set the space between the characters. This property allows to set the required space between characters and also used to returns the space between characters. Syntax: It returns the letterSpacing property.object.style.letterSpacingIt used to se 2 min read HTML DOM Style minHeight Property The minHeight property in HTML DOM is used to set or return the minimum height of an element. This property affects only on block-level elements, absolute or fixed position elements. Syntax: It returns the minHeight property.object.style.minHeightIt is used to set the minHeight Property.object.style 2 min read HTML | DOM Style counterReset Property The Style counterReset property in HTML DOM is used to create or reset counters. This property is used with the counterincrement property and the content property.Syntax: It is used to return the counterReset property. object.style.counterResetIt is used to set the counterReset property. object.styl 1 min read HTML | DOM Style borderWidth Property The borderWidth property in HTML DOM is used to set or return the width of the border element. Syntax: It is used to set the border of width. object.style.borderWidth = valueIt returns the border width property. object.style.borderWidth Return Value: It returns the selected border element with the g 4 min read HTML | DOM Style justifyContent Property The style justifyContent property in HTML DOM is used to align the items horizontally when they are not able to use all the available space. It is used to set the position of the element. By default, the items are positioned at the beginning of the container. Syntax: It returns the justifyContent pr 3 min read Like