CSS tips: How to occupy space when DIV is empty _ experience exchange

Source: Internet
Author: User
If the width of the div element is set, for example, width: 100%, the div occupies physical space in IE (IE6, IE7, FF does not occupy physical space (correct understanding ). To express the style intuitively, write the style directly in the element Tag: What affects the final display in IE at this time, and how to resolve it?

Possible influencing factors: font-size, line-height, height, and overflow)

Let's add filter attributes to the above Code one by one (if you are interested in the specific process, you can experiment with it privately and "Do It Yourself "!)

During the test, you will find that the resolutions of IE6 and IE7 are also different. For example, after setting the line-height: 0; height: 0; style for p, IE7 shows that it is normal and no longer occupies physical space, while IE6 is still on its own, or sad!

The simplest method for the final test result is to set the height and overflow attributes for p:

This article comes from WEB development network Original article link: http://www.cncms.com.cn/css/9642.htm

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.