左側(cè)固定,右側(cè)自適應(兩種方法任選)
發(fā)布時間:2016-12-23 10:59:12 作者:MrLQZ
我要評論

本文主要介紹了左側(cè)固定,右側(cè)自適應的兩種實現(xiàn)方法,相信對大家學習網(wǎng)頁布局會有很好的幫助,下面就跟小編一起來看下吧
第一種方法:
<!DOCTYPE> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .one { position: absolute; height: 200px; width: 300px; background-color: blue; } .two { height: 200px; margin-left: 300px; background-color: red; } </style> </head> <body> <div class="one"></div> <div class="two">第一種方法</div> </body> </html>
第二種方法:
<!DOCTYPE> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .one { float:left; height: 200px; width: 300px; background-color: blue; } .two { overflow: auto; height: 200px; background-color: red; } </style> </head> <body> <div class="one"></div> <div class="two">第二種方法</div> </body> </html>
以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對大家的學習或者工作能帶來一定的幫助,同時也希望多多支持腳本之家!
相關(guān)文章
CSS左側(cè)固定寬 右側(cè)自適應的實現(xiàn)代碼(兼容所有瀏覽器)
下面小編就為大家?guī)硪黄狢SS左側(cè)固定寬 右側(cè)自適應的實現(xiàn)代碼(兼容所有瀏覽器)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-05-26- 這個是我練習做網(wǎng)頁查資料查到的,有很多不錯的布局。將其總結(jié),并寫上自己使用的一些感悟。2010-02-23