Div cannot be directly nested in UL (earlier than IE7)

Source: Internet
Author: User

At ordinary times in order to write a JS effect, thus ignoring the nesting of the label, leading to the confusion of the IE6-7, In UL, directly nested Div, in IE7 versions earlier, will appear in the situation is: the DIV is wrapped in Li, which is closest to it.
See Dome

<Ul class = "Clearfix"> <li> 1 </LI> <li> 2 </LI> <li> 3 </LI> <li> 4 </LI> <li> 5 </LI> <Div class = "add"> <! -- This part will be loaded to Li with 5 text in IE7 and earlier versions. --> </Div> </ul>

CSS

<Style type = "text/CSS">. clearfix {display: inline-block; width: 100% ;}. clearfix Li {float: Left; padding: 5px; Border: 1px solid #999; width: 12%; List-style: none ;}. add {Background: #67bcd1; Height: 20px ;}</style>

Under Google
 
In IE7 document mode, the DIV is added to the Li closest to it.
 
So and UL do not support writing directly nested Div statements.

Div cannot be directly nested in UL (earlier than IE7)

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.