求 html+div Layout

lnq 2012-11-02 01:37:36
最好有 Top+三栏+footer,

三栏中中间要固定,左右二边随着屏幕在大小变动而变动(但要求宽度相等)。同时左右二边等使用填充色(不能用从上到下的,只能用从左到右或从到右到左),这样才能保持一致。
...全文
105 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sweet_ 2012-11-06
  • 打赏
  • 举报
回复

我去图片放错位置了
sweet_ 2012-11-06
  • 打赏
  • 举报
回复

<!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>
</head>
<style type="text/css">
.header{ background-color:red; height:auto; width:400px; height:30px; line-height:30px; text-align:center;}
.left{ position:relative; float:left; width:100px; background-color:#00F; height:400px; text-align:center;line-height:400px;}
.main{ float:left; width:300px; background-color:#C66; text-align:center; line-height:400px;}
.footer{clear:both; width:400px; height:50px; background-color:#6CC; text-align:center; line-height:50px; }
</style>

<body>
<div style="margin-left:auto; margin-right:auto; margin-top:40px; width:400px; ">
<div class="header">头部</div>
<div class="content">
<div class="left">侧边</div>
<div class="main">主体</div>
</div>
<div class="footer">底部</div>
</div>
</body>
</html>


是这样么?
lnq 2012-11-02
  • 打赏
  • 举报
回复
这里有二个例子,但我不知道如何调其参数

http://www.css-lab.com/demos/3col-fl...-fix-cntr.html
http://www.css-lab.com/demos/3col-fl...fixcenter.html

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧