In the Web page we often set the font of the text in the page, with the font-family this property can be used to set the font style. So we're going to teach you how to set this up from HTML fonts to CSS fonts.
Original HTML font settings
HTML text font setting code:
<font face= "Blackbody" > I am a bold character </font>
CSS font settings
CSS Font Property Word
Font-family
CSS font CSS font-family how to use:
Font-family: "Set the font name";
Exp:
CSS uses example code:
. div{font-family: "Blackbody";}
Corresponding HTML code:
<div class= "div" > I am also blackbody font </div>
Description: The above CSS font-family font case, including the original HTML font settings and CSS font settings.
Font selection Tips
CSS Font Common We use "bold", "Arial" This 2 kinds of Chinese fonts, this is why, because the page loading select font is called when the visitor system text Library text font, if not find the font that will show the default page font. Each of the installed operating systems (XP\VISTA\WIN7, etc.) includes these Chinese fonts by default. This allows us to use the fonts that each of the individual operating systems bring with them, so we cannot set the font of the text that we install individually. If we set our own installed fonts, on our own computer will be implemented to set the font style, and other users to browse this page when the text font in this page will be very different.
font-family Font Selection
We have tips on choosing CSS properties and values in the VIP course.
We recommend the characters commonly used body is:
Arial, blackbody, Microsoft ya Black, Arial, Helvetica, Sans-serif this 4 kinds of fonts.
Font-family Summary
Use CSS font-family font settings for object text, pay attention to the use of characters commonly used body, do not set your own installed fonts as the font of the Web page, so that others browse your Web page when no such font, text is not beautiful. Usually recommended fonts: bold, Arial, Microsoft Jas Black, Helvetica, Sans-serif.
The method of font setting and precautions so much, I hope you can master, more exciting please pay attention to the PHP Chinese network other related articles!
Related reading:
How to use the Padding property in CSS
HTML Editor Converter
How to know that browser support does not support HTML