CSS3 font-face font
The CSS3 font-face font design is a new font application attribute of CSS3 . The advantage of the traditional CSS font property font-family is that it can set many different fonts and give them the order, allowing the browser to determine the font in order can normal display, although this function has been significantly beyond even earlier HTML of the face attribute, but there is still a drawback is that if the viewer's computer is not installed font designers want to show, that font-family of the effect may not be revealed, in addition to embedded designers with additional external font file, such a concept, to CSS3 resolved, function CSS3 font-face property is a combination of functions embedded fonts and external fonts to apply to become perfect s solution.
CSS3 font-face property syntax structure
@font-face{
font-family: NewFont;
src: local (font file), url (font file URL);
font-weight: bold; //set to bold font , This line is optional
}
<!--Call font-->
font-family:NewFont;
CSS3 font-face font design example
@font-face {
font-family: NewFont;
src: url(font file);
}
div {
font-family: NewFont, standard regular body, sans-serif;
}
</style >
<div>This is the test text</div>
Note on the use of CSS3 font-face In
fact , the font-face property of CSS3 is just to let the already very useful font-family property, and to increase the opportunity for additional effects. Although the font-face property is still under development, It has also been supported by many new versions of browsers, but the concept of font-face attribute will allow browsers to download font files as appropriate, so pay attention to the copyright issues of font files, and do not use unauthorized font files at will. Moreover, fonts that are not claimed to be free on the Internet can be used. The details of the authorization must be read carefully. If there is any uncertainty, do not use it. Then there is the problem of the download speed of the font file. If the download speed of the font file planned by the designer is different from the speed of the web page loading, there will be a problem of screen jumping when opening the web page.
Post a Comment
0 Comments