float position的測試案例,floatposition案例

來源:互聯網
上載者:User

float position的測試案例,floatposition案例

根據<a target=_blank href="http://blog.csdn.net/goodshot/article/details/44348525">http://blog.csdn.net/goodshot/article/details/44348525</a>我的測試
 
<p>一、</p><p>1.Container div is overflow is not seted ,float element is not be envoloped <br><br>  2.And the postion is seted "static" which means it is not affluncented by the css top and left ect.  <br><br>  3.According to this example,we can see the "float" css attribute is only set the element in the 0 z-index layer.   </p><div  style="background-color:#CCC;;"  ><div style="width:100px;height:100px; background-color:blue;  "></div> <div style="width:100px;height:100px; background-color:olive; float:left; margin-left:30px"></div></div>


 

 

二、<br><br>1.Container div is overflow seted ,float element is be envoloped<div  style="background-color:#CCC;; overflow:auto"  > <div style="width:100px;height:100px; background-color:olive; float:left; margin-left:30px; margin-top:20px">2.this is means masked.in the 0 z-index layer.</div> <div style="width:100px;height:100px; background-color:blue;  ">2. The static position is the default postion option,then this blue div is not affected by the "top" "left" ect. attributes ,the we can see it is located in the initial position. </div></div>

下面的是在FF中的

三、use "box-set"( always named "clearfix" in chinese "萬能閉合")<br><br><div style="background-color:#696;overflow:auto; " class="box-set" > <div style="width:100px;height:100px;background-color:#0FF; float:left; margin-top:100px; margin-left:1000px;"></div><br><br>


四、parent div used css class "box-set" or "overflow:auto" can't affect the div in it. position method float doesn't  work in this way .Only margin-left or margin-top can locate the div in float way. <div style="background-color:#696;overflow:auto; " class="box-set"><div style="position:absolute; left:200px ; top:120px ;  width:100px ; height:100px; background-color:#69F"></div><div style="position:float; left:200px ; top:200px ;  width:100px ; height:100px; background-color:#69F"></div></div>


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.