How to set the font style in CSS

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.