CSS | font-style Property
In CSS, if we want to give designing to any type of text then we can make the use of CSS font style attribute. It helps to make a better user experience.
Syntax:
font-style: normal|italic|oblique|initial|inherit;
Property values:
Syntax:
font-style: normal;
Example:
<!DOCTYPE html> <html> <head> <title> CSS | font-style Property </title> <style> p.a { font-style: normal; } </style> </head> <body> <h1>Normal font-style Property</h1> <p class="a">GeeksforGeeks</p> </body> </html> |
chevron_right
filter_none
Output

Syntax:
font-style: italic;
Example:
<!DOCTYPE html> <html> <head> <title> CSS | font-style Property </title> <style> p.a { font-style: italic; } </style> </head> <body> <h1>Italic font-style Property</h1> <p class="a">GeeksforGeeks</p> </body> </html> |
chevron_right
filter_none
Output

Syntax:
font-style: oblique;
Example:
<!DOCTYPE html> <html> <head> <title> CSS | font-style Property </title> <style> p.a { font-style: oblique; } </style> </head> <body> <h1>Oblique font-style Property</h1> <p class="a">GeeksforGeeks</p> </body> </html> |
chevron_right
filter_none
Output

Syntax:
font-style: initial;
Example:
<!DOCTYPE html> <html> <head> <title> CSS | font-style Property </title> <style> p.a { font-style: initial; } </style> </head> <body> <h1>Initial font-style Property</h1> <p class="a">GeeksforGeeks</p> </body> </html> |
chevron_right
filter_none
Output

Example:
<!-- Write HTML code here --><!DOCTYPE html> <html> <head> <title> CSS | font-style Property </title> <style> span { color: blue; font-size: 70px; } .extra span { color: inherit; } </style> </head> <body> <div> <span>GeeksforGeeks</span> </div> <div class="extra" style="color:green"> <span>GeeksforGeeks</span> </div> <div style="color:red"> <span>GeeksforGeeks</span> </div> </body> </html> |
chevron_right
filter_none
Output
Supported Browsers: The browser supported by are listed below:
- Google Chrome 1.0
- Internet Explorer 4.0
- Firefox 1.0
- Opera 7.0
- Safari 1.0
Recommended Posts:
- HTML | DOM Style fontStyle Property
- CSS | transition-property Property
- CSS | nav-right property
- CSS | top Property
- CSS | nav-down property
- CSS | all Property
- CSS | right Property
- CSS | flex Property
- CSS | animation-name Property
- CSS | min-width Property
- HTML | DOM id Property
- CSS | border-top Property
- CSS | columns Property
- CSS | clip Property
- CSS | perspective Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



