-
按照百分比來設置板塊的寬度,即可實現自適應查看全部
-
<!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 type="text/css"> body{ margin:0; padding:0; font-size:20px; font-weight:bold} div{ line-height:50px} .left{ width:70px; height:600px; background:#ccc;position:absolute; left:0; top:0} .main{ height:600px; margin:0 80px 0 80px; background:#9CF} .right{ height:600px; width:70px; position:absolute; top:0; position:absolute;right:0;top:0; background:#FCC;} </style> </head> <body> <div class="left">left</div> <div class="main">設計首頁的第一步是設計版面布局。就象傳統的報刊雜志編輯一樣,我們將網頁看作一張報紙,一本雜志來進行排版布局。 雖然動態網頁技術的發展使得我們開始趨向于學習場景編劇,但是固定的網頁版面設計基礎依然是必須學習和掌握的。它們的基本原理是共通的,你可以領會要點,舉一反三。</div> <div class="right">right</div> </body> </html>查看全部
-
讓元素脫離文檔流,使用position:absolute查看全部
-
布局 又稱版式布局查看全部
-
什么叫布局?查看全部
-
混合布局編程挑戰CSS代碼部分 <style type="text/css"> body { margin: 0; padding: 0; font-size: 30px; color: #fff; } .top { width: 100%; height: 100px; background: #ccc; margin: 0 auto; } .main { width: 100%; height: 500px; background: red; margin: 0 auto; } .right { height: 500px; background: #b3e5b3; position: absolute; left: 210px; right: 0; } .left { width: 200px; height: 500px; background: blue; position: absolute; left: 0; } .foot { width: 100%; height: 100px; background: #e65b00; margin: 0 auto; } </style>查看全部
-
兩列自適應布局。查看全部
-
為什么right背景色不見了。后面多一個大括號,不謝!我也是看到別人寫的哈哈哈查看全部
-
混合布局,中間兩列,左邊固定,右邊自適應,使用父元素相對定位,子元素絕對定位。查看全部
-
三列布局,兩端固定,中間自適應查看全部
-
浮動(float)和 絕對定位(position:absolute)可以讓元素脫離文檔流查看全部
-
css布局查看全部
-
<!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 type="text/css"> body{ margin:0; padding:0; font-size:30px; color:#fff} .top{ width: 100%; background-color: red; height: 100px; } .main{ height: 1000px; margin:0 auto; background-color: yellow; width:800px; } .left{ float: left; width: 200px; height: 1000px; background-color: black; } .right{ width:70%; height:1000px; float: right; margin:0 auto; background-color: #666; } .foot{ height:100px; clear: both; margin:0 auto; background-color: #696; } </style> </head> <body> <div class="top">top</div> <div class="main"> <div class="right">right</div> <div class="left">left</div> </div> <div class="foot">foot</div> </body> </html>查看全部
-
<style type="text/css"> body{ margin:0; padding:0; font-size:30px; color:#fff} .top{width:100%;height:80px;background:grey;} .main{width:100%;height:600px;background:red;} .left{ width:200px;height:600px;background:blue;position:absolute;margin-left:0;} .right{height:600px;width:100%;background:green;float:right;position:absolute;margin-left:210px;} .foot{width:100%;height:50px;background:yellow;} </style>查看全部
-
網頁的主要元素是文本和圖片,網頁設計的特點有兩個(一個是網頁可以自適應寬度、二是網頁的長度理論上沒有限制) 網頁一般分為三部分:頭部、內容、底部;再根據內容的多少給網頁分欄(又稱分列):一列布局、二列布局、三列布局、混合布局等) 通過浮動和定位來實現UI設計功能查看全部
舉報
0/150
提交
取消