Solve problem "Set the Font Family of an Element" online - Learn Python 3 - Snakify

Lesson: HTML5 and CSS

Set the Font Family of an Element

You can set an element's font by using the font-family property.

For example, if you wanted to set your h2 element's font to Sans-serif, you would use the following CSS:

h2 {
  font-family: Sans-serif;
}

Make all of your p elements use the Monospace font.


The content on this page is licensed under Attribution-ShareAlike 4.0 International. Original authors: freeCodeCamp, the content was modified.