Home  >  Article  >  Web Front-end  >  How to set font with css

How to set font with css

藏色散人
藏色散人Original
2021-04-19 09:18:024553browse

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.

How to set font with css

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.

How to set font with css

Call the CSS file style in the head.

How to set font with css

For CSS, we most commonly use class or tag names to control styles.

How to set font with css

We control the font used by the font style

How to set font with css

For example, if we want to set the font size, then we can use font -size, to set. [Recommended learning: css video tutorial]

How to set font with css

If we need to set the font style, then we can use font-family

How to set font with css

If we need to make the font bold, then we can use font-weight.

How to set font with css

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.

How to set font with css

#And text-decoration can clean or set underlines in different styles. I used text-decoration:none to remove the underline here.

How to set font with css

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.

How to set font with css

font-style can set the font style

How to set font with css

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn