Home  >  Article  >  Web Front-end  >  How to set the font to Song Dynasty in css

How to set the font to Song Dynasty in css

王林
王林Original
2020-11-18 13:55:396808browse

How to set the font in css to Song Dynasty: You can use the font-family attribute to set it, such as [font-family: Song Dynasty;] or [font-family: SimSun;]. The font-family attribute is used to specify the font of an element.

How to set the font to Song Dynasty in css

Related attributes:

font - The family attribute specifies the font of an element.

(Learning video sharing: css video tutorial)

There are two types of font family names:

family-name - the specified family name : The name of the specific font, such as: "times", "courier", "arial".

generic-family - Common font family names: For example: "serif", "sans-serif", "cursive", "fantasy", "monospace.

Example:

<style>
.s{
    font-family: SimSun;
}
.ss{
    font-family: 宋体;
}
</style>

</head>
<body>
    <p class="s">测试宋体</p>
    <p  >测试宋体</p>
    <p class="ss">测试宋体</p>
</body>

Effect:

How to set the font to Song Dynasty in css

Related recommendations:CSS tutorial

The above is the detailed content of How to set the font to Song Dynasty in 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