Introduction to sharing font-size grammar and tutorials on relevant examples

Source: Internet
Author: User
Font-size Syntax:

Font-size:absolute-size | Relative-size | Length

Parameters:
Absolute-size: Adjusts according to the font of the object. Xx-small | X-small | Small | Medium | Large | X-large | Xx-large
Relative-size: Relative to the parent-to-image font size. Calculated using proportional em units. larger | Smaller
Length: Percent | A length value consisting of floating-point numbers and unit identifiers, which cannot be negative. The percentage value is based on the size of the font in the parent object. See Length Units

Description
Sets or retrieves the font size in an object.
The default value is Absolute-size's medium value.
The corresponding script attribute is fontsize. Please refer to the other bibliography I have written.
Example:

p {font-style:normal;} p {font-size:12px;} p {font-size:20%;}

In web design, how is the font size accurate?

General Chinese font size is 12px or 14px. With the increasing resolution of the monitor, 12px of text in larger than 1440*900 of the display will appear relatively small, reading is not very easy, so now the web design with 12px is already relatively few, especially the body part of the article, the general will use 14PX. 13px font under IE6 There will be a little bit of the bug on the display, so now use not too much, but with IE6 slowly eliminated, this problem is no longer a problem. And for the title bar of the text size, no special restrictions, visually feel comfortable on the line.
Font Size code: FONT-SIZE:14PX (font size 14 pixels)
For font-family, generally 14px and below the size of the text, should be set to the song body, of course, can also be set to Microsoft Ya black. However, the default is not in the XP black font, so in the CSS can be set in this font:
font-family: "Microsoft Yahei", simsun,arial;
A few fonts separated by commas, if the system does not have the first font, use the second, if there is no second one with a third, and so on.

On the problem of font-size inheritance in CSS

Font-size is a CSS style that sets the font, the value can be: px or em;
Inheritance is determined by the parent element, if the parent element has already defined the font size, the child element does not set the font size, then the parent element's font-size value is used by default, or you can set its value individually for an element

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.