CSS font Usage Definition detailed

Source: Internet
Author: User

CSS font seems to be simple in the CSS can not be simple, almost every CSS start position will see the Font page fonts definition, if you just contact CSS, and you should look at this tutorial, will be the CSS font settings to do detailed explanation.

  First, CSS uses the "Font-size" property to control the font size.

For the font-size unit is: points, pixels and other units, that is, pt/px;14px font size equivalent to 10.5pt,9pt equivalent to 12px, you can convert this relationship.

CSS to define the page everywhere on the 9th font, you can define font:body{font-size:9pt}, so that in the body area of the page, all fonts will be displayed as 9th words, if you have other elements of the page layout, such as TD, You can also define the font size to display in TD individually: td{FONT-SIZE:10PT} so that even though the font is defined in the body, the TD is redefined, so that when the browser executes, it matches the most recent definition, and the font size will display 10pt.

Tell the browser to display the characters in the label with a size of 9 points, this page uses 9pt font, I think "song Body +9pt" is a very beautiful choice. Points is a unit that determines the size of the text, and it works on all browsers and operating platforms.

The following is the difference between the use of px/pt: PX is the English "pixel" pixels abbreviation, the disadvantage is that the page display is not stable, the font sometimes when small, and the use of "point" points, that is, PT does not have this problem.

In addition to PX/PT, you can also use the following units: in (inches), cm (cm), mm (mm).

  Use font-family to define font names

Use CSS to define font names, which is generally the case:

{font-family:arial} You can set only one font.

{Font-family:arial,helvetica,sans-serif} You can also set a variety of fonts, which will find the display in font order.

{font-family: the "Courier New"} font name includes more than 2 words, use quotes.

Third, the font weight control

{Font-weight:bold} font bold, you can also use: Extra-light,light,demi-light,medium,demi-bold,bold,extra-bold and other parameters.

font-family{Font-style:italic} to set the font tilt, you can use the Normal,italic two parameters.

Note : Please pay attention to the triple tutorial channel for more wonderful tutorials,

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.