HTML | DOM Style fontFamily Property Last Updated : 05 Jun, 2022 Comments Improve Suggest changes Like Article Like Report The fontFamily property set/return a list of Font-Family names and generic-family names for text in an element. The web browser will implement the first value it recognizes. Syntax: It returns the fontFamily property.object.style.fontFamilyIt sets the fontFamily Property.object.style.fontFamily = "font1, font2, etc.|initial|inherit" Property Values: ValueDescriptionfont1, font2, etc.List of font-family names and generic-family names separated by a comma.initialSets property in default value.inheritInherits from parent element. Return value:It returns the number of font-family names and/or generic family names. Example-1: Font-family name "Impact". html <!DOCTYPE html> <html> <head> <title>DOM Style fontFamily Property </title> </head> <body> <center> <p style="color: green; width: 100%; font-size: 30px; font-weight: bold;" id="Geek1"> GeeksForGeeks </p> <h2>DOM Style fontFamily Property </h2> <br> <button type="button" onclick="myGeeks()"> Click to change </button> <script> function myGeeks() { // Set font-family 'impact'. document.getElementById( "Geek1").style.fontFamily = "Impact"; } </script> </center> </body> </html> Output: Before click on button: After click on button: Example-2: Font-family name "sans-serif". html <!DOCTYPE html> <html> <head> <title>DOM Style fontFamily Property </title> </head> <body> <center> <p style="color: green; width: 100%; font-size: 30px; font-weight: bold;" id="Geek1"> GeeksForGeeks </p> <h2>DOM Style fontFamily Property </h2> <br> <button type="button" onclick="myGeeks()"> Click to change </button> <script> function myGeeks() { // Set font-family 'sans-serif'. document.getElementById( "Geek1").style.fontFamily = "sans-serif"; } </script> </center> </body> </html> Output: Before click on button: After click on button: Example-3: Font-family names "Comic Sans MS, cursive, sans-serif". html <!DOCTYPE html> <html> <head> <title>DOM Style fontFamily Property </title> </head> <body> <center> <p style="color: green; width: 100%; font-size: 30px; font-weight: bold;" id="Geek1"> GeeksForGeeks </p> <h2>DOM Style fontFamily Property </h2> <br> <button type="button" onclick="myGeeks()"> Click to change </button> <script> function myGeeks() { // Set font-family 'Comic Sans MS, cursive // and sans-serif' document.getElementById( "Geek1").style.fontFamily = 'Comic Sans MS, cursive, sans-serif'; } </script> </center> </body> </html> Output: Before click on button: After click on button: Supported Browsers: The browser supported by HTML | DOM Style fontFamily Property are listed below: Google Chrome 1 and aboveEdge 12 and aboveInternet Explorer 3 and aboveMozilla Firefox 1 and aboveOpera 3.5 and aboveSafari 1 and above Comment More infoAdvertise with us P PranchalKatiyar Follow Improve Article Tags : Web Technologies HTML HTML-DOM HTML-Property Similar Reads HTML DOM Style paddingLeft Property 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 v 2 min read HTML DOM | Style paddingRight Property 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|initi 2 min read HTML | DOM Style pageBreakBefore Property The pageBreakBefore property in HTML DOM is used to set or return the page-break-before characteristics before the specified element in HTML document. This property works in print and print preview mode. The pageBreakBefore property has no effect on absolutely positioned elements in the HTML DOM. Th 2 min read HTML | DOM Summary Object The DOM Summary Object is used to represent the HTML <summary> element . The Summary element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where âidâ is the ID assigned to the âsummaryâ tag. Example-1: html <!DOCTYPE html> <html> <head> <title> 2 min read HTML | DOM Style userSelect Property The DOM Style UserSelect Property is used to set or return whether the text can be selected by the user or not. Syntax: It is used to return the property: object.style.userSelectIt is used to set the property: object.style.userSelect = "auto|none|text|all" Properties : auto: It has the default value 2 min read HTML | DOM Title Object The Title Object in HTML DOM is used to represent the HTML <title> element. The <title> element can be accessed by using getElementByTagName() method. Syntax: document.getElementByTagName(); Properties: The title object contains single property text which is used to set or return a text 2 min read HTML DOM | Style paddingLeft Property The Style paddingLeft property is used for setting or returning the left 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.paddingLeftTo set the property: object.style.left = "auto|length|%|initial|in 2 min read HTML | DOM Style paddingBottom Property The Style paddingBottom property is used for setting or returning the bottom 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.paddingBottomTo set the property value:object.style.paddingBottom = "%|len 2 min read HTML DOM Style outlineOffset Property The Style outlineOffset property in HTML DOM is used to set or return the outline offset and draw it beyond the border edge. Outlines do not take space, unlike borders. It returns a string that represents the outline-offset property of an element. Syntax: Return the outlineOffset property.object.st 1 min read HTML | DOM Style paddingTop Property The Style paddingTop property is used for setting or returning the top 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.paddingTopTo set the property:object.style.paddingTop = "%|length|initial|inher 2 min read Like