UL Li in IE7 and the following version issues

Source: Internet
Author: User

1, in the IE7 and the following version, the UL can not appear in the non-Li tag, if the appearance of non-Li tags, then the browser will automatically put the non-Li tag with its proximity to the Li tag wrapped, become the content of Li.

Yesterday did a page, IE7 and IE6 did not carry out the test, the results of the business report problem, given the problem page screenshot, a look to know, should be IE problem, with IE8 access no problem, but IE7 and IE6 have problems, carefully look at the code, found no problem, Then use the IE development tool to view the browser parsed HTML structure, found the problem, the problem HTML structure is as follows:

Original HTML:

<ul class= "Demo" >
	<li> This is an example </li>
	<li> This is an instance of </li>
	<li> This is an example </li>
	<li> This is an example </li>
	<li> This is an example </li>
	<div class= "" > This is the UL deposit in a div</div>
</ul>

IE7 after parsing:


IE8 after parsing:


By comparing the IE7 with the IE8, you can see that the normal effect should be like IE8, but IE7 has a different effect, and then compare the two parsed HTML code can be seen, IE7 under the div embedded in Li, and IE8 according to the development of the code will be displayed in the outside of Li. I thought I was in the operating process less write Li close tag, but carefully compared to the code found no problem, from the effect and parse out of the HTML, it should be IE7 does not support the UL directly nested non-LI tags. IE6 under the test also like IE7, so IE6 also is not supported.

Through the network to find relevant information can be reached the same conclusion, can be more confirmed that this is the problem of IE analysis.



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.