Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   
   HTML   
   CSS   
   JAVA SCRIPT   
   JQUERY   




CSS - Font Style


The Font Style or the font-style property in CSS is used to make the text in italic(i.e. Slightly tilted text).


Font Style in CSS


Usually the font-style property in CSS is used to apply the style italic to the text. It has three values,

  1. normal


    Which keeps the text as is.

  2. italic


    Which makes the text in italic.

  3. oblique


    Which is quite similar to italic but is not widely used.

Let us understand Font Style with the below example.


Example of Font Style in CSS


Example :



<html>
<head>
	<style>
		p {
  			font-style: italic;
  		}
	</style>	
</head>
	
<body>
	<p> 
		This is the first paragraph.
	</p>
</body>
</html>


Output :




So, if you look at the above example, we have defined the Font Style, setting the font-style as italic.


<style>
	p {
		font-style: italic;
	}
</style>

And if you look at the above output, the text is a little tilted giving it italic effect.