Length problem in CSS-------Day76

Source: Internet
Author: User

Today did not continue yesterday's question, because today does not have the time, has always felt oneself is busy, but the gratifying is, before I was busy confused, now I am busy in the inspirational ... Remember that there is a very good saying, "those who want to understand can not do things, often do not want to understand", this sentence let me admire for a long time, those who have the days always remind me to cherish the present.


Talk about some of the CSS distance, there are roughly px, EM, PT, PC, in, MM, CM, ex eight kinds, the most common to the PX, I also saw the ex and MM, CM, of course, the latter two see more in the year.


In fact px, we are most familiar with, but also on the computer to apply the most, because the resolution of the monitor is ... px*....px, we know that the resolution is not for the browser maximum when the actual interface is more convenient and concise, there should be a reason for it.

The EM is the relative length unit, which is relative to the default font size of the system;

As for our most common mm and cm is our pure sense of cm and mm, they are absolute length units, with the "absolute" also know it.


And the rest of the four, I have seen less, but here is still some of its problems simply record it:

Ex is also relative length, and its reference is not the default font size of the system, but rather the height of the character "X";

In, PC, PT are absolute length, the conversion between them is:1in=2.54cm=25.4mm=72pt=6pc;

Of course the relative length also has its corresponding conversion relationship, that is : 16px=1em=100%=12pt;


It is important to note that thepx still has drawbacks : under IE6, font scaling is not possible.


It's late again, go to sleep ...




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.