Why should you list more than one font if you are formatting some text using CSS?

A. Not every browser supports every font.
B. CSS will select the font that fits best on the page.
C. CSS will use different fonts when the page is refreshed.
D. All of the fonts will appear in the webpage.

Answer :

One should list more than one font while formatting because not every browser supports every font. The correct option is A.

When using CSS to format text, it is important to list more than one font because not every browser supports every font. By providing multiple fonts, known as a font stack, you ensure that if the primary font is not available, the browser will fall back to the next specified font, and so on, until it finds one that is supported. This practice contributes to a more consistent and readable user experience regardless of the user's browser or operating system.

Reasons to List Multiple Fonts in CSS

  1. Not all browsers support every font, so specifying fallback options helps maintain consistency in appearance.

  2. Ensures the webpage remains readable and functional even if the primary font fails to load.

  3. Provides a better user experience across different devices and operating systems by using widely supported fonts.

For example, a CSS font-family property might look like this: font-family: 'Open Sans', Arial, sans-serif; where 'Open Sans' is the primary font, 'Arial' is the fallback, and 'sans-serif' is a generic fallback type.

Answer:

Because if one font is not available, it will fall back on the ones that are. By providing several, you have a higher level of control over what happens to the site if a browser does not support one of the fonts. The alternative is the browser deciding to use it's own default font as a fallback. This can result in the webpage looking weird.