SyntaxStudy
Sign Up
Home CSS Reference font-family

font-family

property

Specifies the font for text. Always include fallback fonts and a generic family.

Syntax

font-family: "Font Name", fallback, generic-family;

Example

css
body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

.code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.serif {
    font-family: 'Georgia', 'Times New Roman', serif;
}

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');