IE6, 7, the existence of blank characters between HTML tags, resulting in the use of extra white space after rendering, and how to solve

Source: Internet
Author: User

Direct:


Cause: The div contains content that is printed on the background, and output by the print operation. If you do not output anything, the browser will default to the blank area.
In IE6, 7, when the browser resolves the rendering, it is assumed that the whitespace is also a placeholder , by default it has the attributes of the font, so there is a "redundant placeholder" bug.

Workaround:

First, let the HTML tag phase output.  such as:<div></div>. --Too much trouble, code is irregular, not good maintenance.

Second, set up font-size:0; --Not perfect fix~

Second, use the comment <!---->.  For example:<div><!----></DIV>, so there are no whitespace characters in the middle of the div. -This can fix the problem, but not good enough

Third, use <wbr> label .  such as:<div> <wbr><div>. --This allows the browser not to automatically add whitespace to the contents of the tag, and no extra information appears on the page, perfect solution ~

Additional knowledge:

WBR Tags: function is soft line, the browser will be based on the width of the container, the text content to automatically break

Compatibility:

View URL: http://www.quirksmode.org/oddsandends/wbr.html

IE6, 7, the existence of blank characters between HTML tags, resulting in the use of extra white space after rendering, and how to solve

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.