Perfect Web Design application: Use CSS to set fonts flexibly

Source: Internet
Author: User
css| Design | Web page design

Use DIV+CSS to write site structure also has a period of time, in this process found that sometimes need to set the font to 12PX, and smaller than 14px font (13px in IE can not distinguish between the size and 12px). Today found with Font-size:small; It's good to control the size of the font.

First set a base value in the label

Body{font-size:small;}

Based on this font size, set percentages in other labels

h1{font-size:120%;}
h2{font-size:110%;}
note{font-size:80%;}

As the underlying values change, other fonts will change, and only the underlying values in the body need to be modified.

Using small as the base value allows users to adjust the size according to preferences, the user's adjustment does not affect the overall font imbalance. Also, when you press CTRL + Scroll the middle mouse button, you can zoom the font size of the page.



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.