目錄
左右两边高度自适应,右边宽度为浏览器宽度-200px。这个是怎么理解的呀?_html/css_WEB-ITnose
右邊
寬度
瀏覽器
自適應
按照图片那样的排版,但是,但是,错了。求正确写法?先谢谢各位啦~~~
不理解右边的那个宽度是怎么写的?还有不知道错了,是不是右边的宽度计算错误了?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>初试试题</title><style>body { margin:0px 0px; padding:0px 0px; color:#fff; text-align:center;}#header { background:#0175ed; height:120px; line-height:120px;}#header, #footer, #container { margin: 0px auto; width: 100%;}#contentWrap { margin-left: -200px; float:right; width: 100%; background:#86aef7}#content { margin-left: 200px;}#side { float:left; width: 200px; background:#55a3f3;}#contentWrap,#side{ min-height: 500px; height: auto !important; height: 500px;}#footer { clear: both; background:#0175ed; height:50px; line-height:50px;}</style></head><body><div id="container"><div id="header">高度120px</div><div id="main"><div id="contentWrap"><div id="content">右边宽度100%-200px</div></div><div id="side">左边宽度200px</div></div><div id="footer">底部高度50px</div></div></body></html>
登入後複製
回复讨论(解决方案)
右边宽度100%-200px
左边宽度200px
--》
右边宽度100%-200px
左边宽度200px
width:100%
position: abusote;
left : 0px;
用padding-left:200px; 来占位吧
右边宽度100%-200px
左边宽度200px
--》
右边宽度100%-200px
左边宽度200px
所以,你这个回复是什么意思呢?
左
高度 自适应 老的浏览器可能不行 所以要 写js计算把
左
高度 自适应 老的浏览器可能不行 所以要 写js计算把 右边=浏览器宽度-200px,这个怎么理解的呀?
这样做可以实现以上所说布局
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>初试试题</title><style>body { margin:0px 0px; padding:0px 0px; color:#fff; text-align:center;}#header { background:#0175ed; height:120px; line-height:120px;}#header, #footer, #container { margin: 0px auto; width: 100%;}#right,#side{ min-height: 500px; height: auto !important; height: 500px;}#side { float:left; width: 200px; background:#55a3f3;}#right { background:#86aef7}#footer { clear: both; background:#0175ed; height:50px; line-height:50px;}</style></head><body><div id="container"> <div id="header">高度120px</div> <div id="main"> <div id="side">左边宽度200px</div> <div id="right">右边宽度100%-200px</div> </div> <div id="footer">底部高度50px</div></div></body></html>
登入後複製
登入後複製
这样做可以实现以上所说布局
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>初试试题</title><style>body { margin:0px 0px; padding:0px 0px; color:#fff; text-align:center;}#header { background:#0175ed; height:120px; line-height:120px;}#header, #footer, #container { margin: 0px auto; width: 100%;}#right,#side{ min-height: 500px; height: auto !important; height: 500px;}#side { float:left; width: 200px; background:#55a3f3;}#right { background:#86aef7}#footer { clear: both; background:#0175ed; height:50px; line-height:50px;}</style></head><body><div id="container"> <div id="header">高度120px</div> <div id="main"> <div id="side">左边宽度200px</div> <div id="right">右边宽度100%-200px</div> </div> <div id="footer">底部高度50px</div></div></body></html>
登入後複製
登入後複製
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 個月前
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
1 個月前
By 尊渡假赌尊渡假赌尊渡假赌
刺客信條陰影:貝殼謎語解決方案
2 週前
By DDD
R.E.P.O.如果您聽不到任何人,如何修復音頻
1 個月前
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.聊天命令以及如何使用它們
1 個月前
By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

CSS自定義resize符號的方法與背景色統一在日常開發中,我們經常會遇到需要自定義用戶界面細節的情況,比如調...

在Safari中使用自定義樣式表的問題探討今天我們來探討一個關於Safari瀏覽器的自定義樣式表應用問題。前端新手...

在網頁中使用本地安裝的字體文件最近,我從網上下載了一種免費字體,並成功將其安裝到了我的系統中。現在...

如何使用JavaScript或CSS控制瀏覽器打印設置中的頁首和頁尾在瀏覽器的打印設置中,有一個選項可以控制是否顯�...

使用CSS實現響應式佈局當我們希望在網頁設計中實現不同屏幕尺寸下的佈局變化時,CSS...
