

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- Set the font style with CSS
- Usage of font-style property in CSS
- HTML DOM Style font Property
- Font Properties in CSS
- Font Family in CSS
- Font Size in CSS
- Font Weight in CSS
- Font Variant in CSS
- CSS font-kerning Property
- CSS font-variant Property
- Style Rules in CSS
- CSS font-size-adjust Property
- Usage of font property in CSS
- CSS outline-style property
- Usage of font-weight property in CSS
Advertisements