CSS tips: How to occupy space when DIV is empty _ experience exchange
Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
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
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.