ie6,7 empty div without any content occupy space problem solving

Source: Internet
Author: User

When there is no content in the div tag in IE (IE6,IE7) will occupy space, in other browsers there is no such phenomenon, in fact, the solution is very simple, there is this experience, the need for friends can refer to this article, hoping to help everyone

When there is no content in the div tag:
<div></div>
If you set the width of the div element, such as width:100%, the Div will occupy space in IE (IE6,IE7) and not occupy the space in other browsers.

Copy Code code as follows:
<div style= "width:100%" ></div>


The easiest way to do this is to set the height and overflow (overflow) attribute on the DIV:

Copy Code code as follows:


<div style = "width:100%;" height:0; Overflow:hidden; "></div>

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.