Add Font Family details (#28719)
* Add Font Family details * fix: removed unnecessary comment
This commit is contained in:
committed by
Randell Dawson
parent
2e939bcd66
commit
8a2927ff99
@ -3,8 +3,18 @@ title: Set the Font Family of an Element
|
||||
---
|
||||
## Set the Font Family of an Element
|
||||
|
||||
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/responsive-web-design/basic-css/set-the-font-family-of-an-element/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
|
||||
In CSS, you can define the type of font used as part of a Font Family. It's recommended to include a set of font types, mostly used for fallback mechanism such that when one Font is not available, the system will fallback to render text using the next available font, and so on.
|
||||
|
||||
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
|
||||
As a rule of thumb, start by providing font family of your choice and end with commonly available fonts such that if the browser is not able to render text using user specified font, then it will use the generic font type as last resort.
|
||||
|
||||
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
|
||||
A few things to keep in mind:
|
||||
* It is recommended to include more than one font family (mostly for fallback purposes)
|
||||
* If the name of the font family is more than one word, it must be in quotation marks, like: "Times New Roman"
|
||||
|
||||
```css
|
||||
p {
|
||||
font-family: "Times New Roman", Helvetica, serif;
|
||||
}
|
||||
```
|
||||
|
||||
This will advise the browser to render text using ```Times New Roman``` first (if available), and then ```Helvetica``` (if Times New Roman isn't available), and finally ```serif``` if none of the other fonts are available.
|
||||
|
Reference in New Issue
Block a user