HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Set the font for an element to italic"
The fontStyle property sets or returns whether the style of the font is normal, italic or oblique.
Property | |||||
---|---|---|---|---|---|
fontStyle | Yes | Yes | Yes | Yes | Yes |
Return the fontStyle property:
Set the fontStyle property:
Value | Description |
---|---|
normal | Font is normal. This is default |
italic | Font is in italic |
oblique | Font is in oblique |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | normal |
---|---|
Return Value: | A String, representing the font style of the text in the element |
CSS Version | CSS1 |
A demonstration of possible values:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("demo").style.fontStyle = listValue;
Return the font style of an element:
alert(document.getElementById("demo").style.fontStyle);
CSS tutorial: CSS Font
CSS reference: font-style property
HTML DOM reference: font property