Font-size: 100%

Source: Internet
Author: User

H1, h2, h3, h4, h5, h6 {font-size: 100%; font-weight: normal ;}

Input, select, textarea, samp {font-size: 100% ;}

I can see some css resetting. What is the purpose and function of setting font-size: 100%?

Bytes ---------------------------------------------------------------------------------------

Suppose you set body {font-size: 12px ;}

But h1 will not inherit this 12px, it will increase the font size according to a certain percentage, but if you explicitly specify font-

Size: 100%; it inherits the font size set by the body.

1. It changes the default size.

2. These elements do not inherit the font size of the parent. They can be automatically inherited after font-size: 100% is set.

  

Parameters:

Normal: the default Row Height.

Length: percent number | length value composed of floating point numbers and unit identifiers, which can be negative values. The percentage value is based on the font height. See length unit

Description

Retrieves or sets the Row Height of an object. That is, the distance between the bottom of the font and the top of the font.

If the row contains multiple objects, the maximum row of the application is high. The Row Height cannot be a negative value.

The corresponding script feature is lineHeight. For more information, see my other bibliography.

Example

Div {line-height: 6px ;}

Div {line-height: 10.5 ;}

Note:

1. line-height is used only for text.

2. use dreamweaver to view the real-time line-height effect.

3. Negative values can be used when line-height is used.

Note that the line-height solution is slightly different in different browsers, with a 1px difference between the top and bottom. If the row height is an even number, in most browsers, the explanation is still normal. If it is an odd number, Some browsers will get 1px more than others, while others will get 1px more than others. For some websites with strict requirements, we recommend that you use an even number for high design.

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.