css響應式布局 相容ie6

來源:互聯網
上載者:User

標籤:css兩欄布局   三欄布局   

1、兩欄布局  左側定寬   右側自適應

<div class="grid1">    <div class="left_1">左側定寬</div>    <div class="right_1">右側自適應</div></div>
.left_1{float:left; width:200px;}.right_1{margin-left:200px;}


2、兩欄布局  左側自適應   右側定寬

<div class="grid2 clearfix">    <div class="left_2">左側自適應</div>    <div class="right_2">右側定寬</div></div>
.left_2{float:left; width:100%; margin-right:-200px;}.right_2{float:right; width:200px;}


3、三欄布局   兩側定寬   中間自適應

<div class="grid3 clearfix">    <div class="left_3">左側定寬</div>    <div class="center_3">中間自適應</div>    <div class="right_3">右側定寬</div></div>
.left_3, .right_3{position:relative; float:left; width:200px;}.left_3{margin-right:-200px;}.right_3{margin-left:-200px;}.center_3{float:left; width:100%;}


4、三欄布局   左側自適應   中間和右側定寬

<div class="grid4 clearfix">    <div class="left_4">左側自適應</div>    <div class="center_4">中間定寬</div>    <div class="right_4">右側定寬</div></div>
.center_4, .right_4{position:relative; float:right; width:200px;}.left_4{float:left; width:100%; margin-right:-400px;}


5、三欄布局   左側和中間定寬   右側自適應

<div class="grid5">    <div class="left_5">左側定寬</div>    <div class="center_5">中間定寬</div>    <div class="right_5">右側自適應</div></div>
.left_5, .center_5{position:relative; float:left;width:200px;}.right_5{margin-left:400px;}


650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/88/FF/wKioL1gEiOCw4T5nAAAaIBFZeqk983.png" title="QQ20161017160747.png" alt="wKioL1gEiOCw4T5nAAAaIBFZeqk983.png" />


以上寫法可相容5大瀏覽器,及IE6到IE8瀏覽器,具體代碼參考附件











本文出自 “dapengtalk” 部落格,請務必保留此出處http://dapengtalk.blog.51cto.com/11549574/1862698

css響應式布局 相容ie6

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.