CSS Tutorial



CSS FONTS


CSS Fonts

CSS provides several properties to style text fonts, such as:

  • font-family: specifies the font
  • font-size: sets the size of the font
  • font-style: italic or normal
  • font-weight: bold, normal, lighter, etc.
  • line-height: spacing between lines

Example 1: Font Family

This is Arial font (sans-serif).

This is Courier New font (monospace).

This is Georgia font (serif).

Example 2: Font Size and Weight

This text is bold and 24px in size.

This is normal weight and 18px.

Example 3: Font Style and Line Height

This paragraph uses italic style and increased line height for better readability.

Example 4: Using Google Fonts (Roboto)

To use Google Fonts, you need to include a link in your HTML <head> section like this:

<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
  

This text uses the Roboto font from Google Fonts.


🌟 Enjoyed Learning with Us?

Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!

Leave a Google Review