Home > Article > Web Front-end > How to set font with css
How to set fonts with css: first build all the styles into a CSS document, and load the styles by calling the CSS file; then call the CSS file style in the HTML header; finally, through attributes such as font-family Just set the font style.
The operating environment of this article: Windows 7 system, Dell G3 computer, HTML5&&CSS3 version.
We choose to build all our styles into a CSS document and load the styles by calling the CSS file.
Call the CSS file style in the head.
For CSS, we most commonly use class or tag names to control styles.
We control the font used by the font style
For example, if we want to set the font size, then we can use font -size, to set. [Recommended learning: css video tutorial]
If we need to set the font style, then we can use font-family
If we need to make the font bold, then we can use font-weight.
In the process of setting the font, in addition to the commonly used font, the second most commonly used one is text. We can use text to set some other styles of the font, such as text-align You can set the alignment of text.
#And text-decoration can clean or set underlines in different styles. I used text-decoration:none to remove the underline here.
If the container you define is smaller than the width of the text, you can set overflow:hidden. When it overflows, its overflowing content will be automatically hidden.
font-style can set the font style
The above is the detailed content of How to set font with css. For more information, please follow other related articles on the PHP Chinese website!