Font family refers to the specific typeface used for text rendering on a web page. The font family can be changed to give a web page a distinct look and feel.
Font family can be specified in the CSS file using the
font-family property. For example:
In this example, the
font-family property is being used to set the font family for the entire body of the web page to Arial. The
sans-serif fallback is used in case the Arial font is not available on the user's device.
In order to ensure that our web pages are accessible across different devices and screen sizes, it is important to make use of common font families which tend to be more common and available across all platforms.
sans-serif is a common font family that is widely available to most web users. If you are unsure of which font family to use, it is recommended to use a generic family name as the first choice followed by a specific font name.
font-family: "Times New Roman"; to the
font-family: Arial, sans-serif; to the
font-family: Verdana, sans-serif; to the
Sign up to start coding
Already have an account?