HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

CSS Font Style

In CSS, the font-style property is used to define the style of the font for a text element. It allows you to specify whether the text should be displayed in a normal, italic, or oblique style. Here are the possible values for the font-style property:

  • Normal:This is the default value. The text is displayed in a standard upright style.
  • Italic:The text is displayed in an italic style. Italic fonts typically have a slanted appearance.
  • Oblique:Similar to italic, oblique also provides a slanted appearance. However, unlike italic, oblique is a slanting version of the normal (upright) font rather than a distinct font style.

Example

p {
  font-style: normal;
}
p {
  font-style: italic;
}
p {
  font-style: oblique;
}
You can click on above box to edit the code and run again.

Output

This is a paragraph in normal style.

This is a paragraph in italic style.

This is a paragraph in oblique style.

Font Weight

The font-weight property specifies the weight of a font:

Example

p.normal {
  font-weight: normal;
}

p.bold {
  font-weight: bold;
}
You can click on above box to edit the code and run again.

Output

This is a paragraph.

This is a paragraph.