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>, 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!?