ie Dead _ original and CSS related _ experience Exchange

Source: Internet
Author: User


I have two examples here, if your browser is IE, you can test!

1, first look at these lines of code!
Copy Code code as follows:

<body>
<div id= "main" ></div>
<script language= "JavaScript" >
var a = (' <div class= "Listinfo" ><p>p</p><span>span<span></span></div> ");
var b = ';
For (r=0 r<20; r++) {
b = b+a;
}
document.getElementById ("main"). InnerHTML = b;
</script>
</body>

Note: I have written more than one <span&gt, this label is not closed!
Look at the effect, rest assured that this will not die!
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <meta http-equiv=" Content-type "Content=" Tex t/html; Charset=utf-8 "/> <title>css ie</title> </pead> <body> <div id=" main "></div> ; <script language= "JavaScript" > var a = (' <div class= "Listinfo" ><p>p</p><span>span< Span></span></div> '); var b = '; For (r=0 r<20; r++) {b = b+a; } document.getElementById ("main"). InnerHTML = b; </script> </body> </ptml>

I started to add CSS;
Copy Code code as follows:

<style>
. listinfo p{border:1px solid #00CC00; float:left; width:100px;}
. listinfo Span{overflow:hidden; display:block width:100px; border:1px solid #CC3300; float:right;
</style>

Look at the effect, do not want to die do not point!
<textarea id="runcode28766"><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <meta http-equiv=" Content-type "content=" text/html; Charset=utf-8 "/> <title>css ie</title> <style> listinfo p{border:1px #00CC00 solid; width:100px;} . Listinfo Span{overflow:hidden; width:100px; border:1px solid #CC3300; Float:right;} </style> </pead> <body> <div id= "main" ></div> <script language= "JavaScript" > var A = (' <div class= "Listinfo" ><p>p</p><span>span<span></span></div> "); var b = '; For (r=0 r<20; r++) {b = b+a; } document.getElementById ("main"). InnerHTML = b; </script> </body> </ptml></textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

The reason is because a label is not closed, plus float, I looked at home last night for three hours, just basic positioning to here, I am looking for relevant information, see How to say!?
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.