CSS Fonts

Font Properties

  • font-family: sets typeface.
  • font-size: sets text size.
  • font-weight: sets boldness.
  • font-style: sets style like italic.

Web Fonts

Use Google Fonts with @import or @font-face in CSS.

Examples

body { font-family: 'Arial', sans-serif; }

@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
p { font-family: 'Roboto', sans-serif; }