
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
Font Style in CSS
The CSS font-style property is used to specify normal, italic or oblique style for an element’s text.
Syntax
The syntax of CSS font-style property is as follows −
Selector { font-style: /*value*/ }
Example
The following examples illustrate CSS font-style property −
<!DOCTYPE html> <html> <head> <style> h2 { font-style: italic; background-color: steelblue; color: white; } p { font-style: oblique 10deg; } </style> </head> <body> <h2>Fortran Tutorial for Beginners</h2> <p>Fortran, as derived from Formula Translating System, is a general-purpose, imperative programming language.</p> <p>It is used for numeric and scientific computing.</p> </body> </html>
Output
This gives the following output −
Example
<!DOCTYPE html> <html> <head> <style> h3 { font-style: italic; background-color: mediumpurple; color: white; text-align: center; } li { font-family: "Comic Sans MS", cursive; font-style: oblique 5deg; } </style> </head> <body> <h3>Developers Best Practices Tutorial</h3> <ul> <li>Documentation is the key</li> <li>Follow the standards</li> <li>Write to be Reviewed</li> </ul> </body> </html>
Output
This gives the following output −
- Related Articles
- Usage of font-style property in CSS
- Set the font style with CSS
- HTML DOM Style font Property
- Font Properties in CSS
- Font Family in CSS
- Font Weight in CSS
- Font Variant in CSS
- Font Size in CSS
- CSS font-kerning Property
- CSS font-variant Property
- Style Rules in CSS
- Usage of font property in CSS
- CSS font-size-adjust Property
- Setting the font color & style of the console in Node.js
- Usage of font-size property in CSS

Advertisements