Em and EX

Source: Internet
Author: User
Although the meaning of absolute units does not require any explanation, the relative units listed in table 2-2 need more ink.
To speak clearly.
Table 2-2 Relative values and examples
Example of unit abbreviation for relative values *
EM em height:1.2em
Ex ex Height:6ex
Percentage
Height:120%
* Example values are not equal lengths.
Both EM and ex are font-size units, but in CSS they are applied to any element as a unit of length.
First say EM, it represents the width of the letter M in a font, so its exact size depends on the word you use.
Body. And ex, equal to the height of the letter x in the given font (lowercase x represents the middle of the letter of a font)
The height of the part, excluding the letters and the prominent parts of the letter, such as D and P are out of the head.
Percentages are ideal for setting the width of the contained element, at which point the percentage is relative to the width.

Em and EX

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.