HTML | DOM Style outline Property Last Updated : 08 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The Style outline property in HTML DOM is used to set or return all outline properties in one declaration. This property draws a line around an element. It sets or returns the one or more border property in short form. The outline can be set the following properties: outline-widthoutline-styleoutline-color Syntax: It returns the outline property.object.style.outlineIt is used to set the outline property.object.style.outline = "width|style|color|initial|inherit" Return Values: It returns a string value that represents the outline width, style and/or color of an element Property Values: width:It sets the outline width.style:It sets the style of outline.color:It sets the color of the outline.Initial: It sets the DOM outline property to its default value.Inherit: The element inherits its property from parent element. Example 1: Add a thick solid blue outline around the div container. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Style outline Property </title> </head> <body> <div id = "container"> <h1>GeeksforGeeks</h1> <h2>DOM Style outline Property</h2> </div> <script> function myGeeks() { document.getElementById("container").style.outline = "thick solid blue"; } myGeeks(); </script> </body> </html> Output: Example 2: Add a length dashed green outline around the div container. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Style outline Property </title> <style> #container { border: 3px solid black; outline: 3px solid blue; } </style> </head> <body> <div id = "GFG"> <h1>GeeksforGeeks</h1> <h2>DOM Style outline Property</h2> </div> <button onclick = "myGeeks()"> Click Here! </button> <!-- script to set outline style --> <script> function myGeeks() { document.getElementById("GFG").style.outline = "7px dashed green"; } </script> </body> </html> Output: Before Click on the button: After Click on the button: Supported Browsers: The browser supported by DOM Style outline property are listed below: Google Chrome 1Edge 12Internet Explorer 8Firefox 1.5Opera 7Safari 1.2 Create Quiz Comment C ChinkitManchanda Follow 0 Improve C ChinkitManchanda Follow 0 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 Tables10 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