元素設置了float或absolute,脫離了文檔流,若是四周元素沒有浮動瀏覽器
<style> .c2{ width:500px; height:500px; margin:80px; } .no1{ border:1px solid; width:100px; height:100px; } .no2{ border:1px solid red; width:200px; height:100px; float:right; } </style> </head> <body> <div class="c2"> <div class="no1"></div> <div class="no2"></div> </div> </body> <divclass="checkbox"><label><inputtype="checkbox"value=""> Option one is this and that—be sure to include why it's great </label></div> input[type="checkbox"]{ position: absolute; margin-left: -20px; margin-top: 4px \9; } .checkbox label { min-height: 20px; margin-bottom: 0; border: 1px solid; font-weight: normal; cursor: pointer; padding-left: 20px; }