Skip to main content

How do you specify a font for text?

With the font-family property:

css
selector { font-family: "Arial", sans-serif; }

You can specify one or several font names. If the first one is unavailable, the next one is used.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.