Extensive and profound CSS (1)-New discoveries

Source: Internet
Author: User

1. Absolute unit and relative unit: Px and EM (learning, huh, huh)

 

1. Code:

<P style = "Background: #900; color: # 00f; Font: bold 12px/24px helvertica, Arial, sans-serif; Height: 24px; width: 370px; "> lorem ipsum dolor sit Amet, consectetuer adipiscing elit. </P>
<Br/>
<Br/>
<P style = "Background: #090; color: # 00f; Font: bold 12px/2em helvertica, Arial, sans-serif; Height: 2em; width: 370px; overflow: hidden; "> lorem ipsum dolor sit Amet, consectetuer adipiscing elit. </P>

1. Effect:

The previous height is the absolute unit PX, and there is no hidden overflow. The next height is the relative unit em, And the overflow is hidden.

If your browser supports font amplification, you can zoom in the font to see what will happen.

 

 

2.

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.