There is a blank character between html tags under IE6 and 7, which leads to the reason and solution for occupying unnecessary spaces after rendering. ie67

Source: Internet
Author: User

There is a blank character between html tags under IE6 and 7, which leads to the reason and solution for occupying unnecessary spaces after rendering. ie67

Direct:


Cause: the content contained in the div is printed on the background and output. If no content is output, the browser adds a blank character to the blank area by default.
In IE6 and 7, when the browser parses the rendering, it will think that the blank space character is also occupied. By default, it has the font attribute, so there is a bug of "redundant Placeholder.

Solution:

1. Link html tags to the output. For example, <div> </div>. -- It is too troublesome and the code is not regular, so it is not easy to maintain.

2. Set font-size: 0; -- cannot fix perfectly ~

2. Use annotator <! -->. Example: <div> <! --> </Div>, so that there is no blank character in the middle of the div. -- This problem can be fixed, but it is not good enough.

3. Use the <wbr> label. For example, <div> <wbr> <div>. -- In this way, the browser will not automatically add blank characters to the TAG content, and no extra information will be displayed on the page ~

 

Additional knowledge:

Wbr label: the Web browser automatically disconnects text content based on the container width.

Compatibility:

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

Related Article

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.