logo 广告
Loading...
 导航 所在位置:论坛首页 -> ┈┋电脑网络┋┈ -> 网页制作技术 -> 四栏标准DIV+CSS布局示例
回复
标题:四栏标准DIV+CSS布局示例收藏 编辑 删除 楼主 | 上一篇 下一篇
疯狂石头
头像
等级:职业侠客
权限:普通用户
积分:77
金钱:3084
声望:121
经验:121
发帖数:780
注册:2007年10月21日
资料 短消息2008-4-20 10:52:00

四栏标准DIV+CSS布局示例

以下是代码:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Nice and Free CSS Template 4</title>
<style type="text/css" media="screen"><!--
/*  body und schrift deffinitionen */
html {
padding:0px;
margin:0px;
}
body {
background-color: #e1ddd9;
font-size: 12px;
font-family: Verdana, Arial, SunSans-Regular, Sans-Serif;
color:#564b47;
padding:0px;
margin:0px;
}
a {
color: #ff66cc;
font-size: 11px;
background-color:transparent;
text-decoration: none;
}
pre {
color: #564b47;
font-size: 11px;
background-color: #e1ddd9;
font-family: Courier, Monaco, Monospace;
}
p,h1, h3, pre {
padding: 5px 15px;
margin: 0px;
}
h3 {
font-size: 13px;
text-transform:uppercase;
color: #564b47;
background-color: transparent;
}
/*  positioning-layers dynamisch */
#logo {
position: absolute;
right: 2%;
width: 96%;
text-align: right;
top: 20px;
}
#left {
position: absolute;
left: 2%;
width: 19%;
top: 106px;
background-color: #ffffff;
}
#middleleft {
position: absolute;
left: 22%;
width: 28%;
top: 106px;
background-color: #ffffff;
}
#middleright {
position: absolute;
left: 51%;
width: 28%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
#right {
position: absolute;
left: 80%;
width: 18%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
#right, #middleright, #middleleft, #left {
border: 1px solid #564b47;
padding:0px;
margin:0px;
}
--></style>
</head>
<body>
<div id="left">
<h3>left</h3>
<pre>
#left {
position: absolute;
left: 2%;
width: 19%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>Warning</h3>
<p>These pages use certain CSS definitions that are unsupported by older browsers.<br />
<a href="/">more nice and free css templates</a></p>
<p>
<img src="xhtml10.gif" alt="" width="80" height="15" border="0"/><br/>
<img src="css.gif" alt="css" width="80" height="15" border="0"/><br />
<br />
<br />
</p>
</div>
<div id="middleleft">
<h3>middleleft</h3>
<pre>
#middleleft {
position: absolute;
left: 22%;
width: 28%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>Calculations in your head</h3>
<p>This example requires some calculations. The sum of the widths yields 98%. The distance from
the border of body to the first box plus its width plu the distance yields the left position of
the next box.
<p>If you want boxes of different width you need to adjust these values accordingly.</p>
<p>Use of this code is encouraged! </p>
<p>Try it with 2 or 3 columns</p>
<br />
<br />
</div>
<div id="middleright">
<h3>middleright</h3>
<pre>
#middleright {
position: absolute;
left: 51%;
width: 28%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>box border</h3>
<p>Borders, pading and margin are defined in</p>
<pre>
#right,#middleright,#middleleft,#left{
border: 1px solid #564b47;
padding:0px;
margin:0px;
}
</pre>
<h3>Font definitions</h3>
<p>Padding are passed to p, h1 and h3.</p>
<pre>
p,h1, h3, pre {
padding: 5px 15px;
margin: 0px;
}
</pre>
<br />
<br />
</div>
<div id="right">
<h3>right</h3>
<pre>
#right {
position: absolute;
left: 80%;
width: 18%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>open code</h3>
<p>Use of this code is encouraged! (o_.)/</p>
<br />
<br />
</div>
</body>
</html>

以下是HTML脚本特效代码,点击运行按钮可查看效果:

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Nice and Free CSS Template 4</title>
<style type="text/css" media="screen"><!--
/*  body und schrift deffinitionen */
html {
padding:0px;
margin:0px;
}
body {
background-color: #e1ddd9;
font-size: 12px;
font-family: Verdana, Arial, SunSans-Regular, Sans-Serif;
color:#564b47;
padding:0px;
margin:0px;
}
a {
color: #ff66cc;
font-size: 11px;
background-color:transparent;
text-decoration: none;
}
pre {
color: #564b47;
font-size: 11px;
background-color: #e1ddd9;
font-family: Courier, Monaco, Monospace;
}
p,h1, h3, pre {
padding: 5px 15px;
margin: 0px;
}
h3 {
font-size: 13px;
text-transform:uppercase;
color: #564b47;
background-color: transparent;
}
/*  positioning-layers dynamisch */
#logo {
position: absolute;
right: 2%;
width: 96%;
text-align: right;
top: 20px;
}
#left {
position: absolute;
left: 2%;
width: 19%;
top: 106px;
background-color: #ffffff;
}
#middleleft {
position: absolute;
left: 22%;
width: 28%;
top: 106px;
background-color: #ffffff;
}
#middleright {
position: absolute;
left: 51%;
width: 28%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
#right {
position: absolute;
left: 80%;
width: 18%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
#right, #middleright, #middleleft, #left {
border: 1px solid #564b47;
padding:0px;
margin:0px;
}
--></style>
</head>
<body>
<div id="left">
<h3>left</h3>
<pre>
#left {
position: absolute;
left: 2%;
width: 19%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>Warning</h3>
<p>These pages use certain CSS definitions that are unsupported by older browsers.<br />
<a href="/">more nice and free css templates</a></p>
<p>
<img src="xhtml10.gif" alt="" width="80" height="15" border="0"/><br/>
<img src="css.gif" alt="css" width="80" height="15" border="0"/><br />
<br />
<br />
</p>
</div>
<div id="middleleft">
<h3>middleleft</h3>
<pre>
#middleleft {
position: absolute;
left: 22%;
width: 28%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>Calculations in your head</h3>
<p>This example requires some calculations. The sum of the widths yields 98%. The distance from
the border of body to the first box plus its width plu the distance yields the left position of
the next box.
<p>If you want boxes of different width you need to adjust these values accordingly.</p>
<p>Use of this code is encouraged! </p>
<p>Try it with 2 or 3 columns</p>
<br />
<br />
</div>
<div id="middleright">
<h3>middleright</h3>
<pre>
#middleright {
position: absolute;
left: 51%;
width: 28%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>box border</h3>
<p>Borders, pading and margin are defined in</p>
<pre>
#right,#middleright,#middleleft,#left{
border: 1px solid #564b47;
padding:0px;
margin:0px;
}
</pre>
<h3>Font definitions</h3>
<p>Padding are passed to p, h1 and h3.</p>
<pre>
p,h1, h3, pre {
padding: 5px 15px;
margin: 0px;
}
</pre>
<br />
<br />
</div>
<div id="right">
<h3>right</h3>
<pre>
#right {
position: absolute;
left: 80%;
width: 18%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>open code</h3>
<p>Use of this code is encouraged! (o_.)/</p>
<br />
<br />
</div>
</body>
</html>

签名

2008-4-20 10:52:00 顶部
qclove
头像
等级:社区游民
权限:普通用户
积分:1
金钱:46
声望:5
经验:5
发帖数:5
注册:2008年9月4日
  资料  消息 短消息编辑 删除 引用 第2楼
怎么用啊
签名
2008-9-9 13:41:35 顶部
第1页 共1页 共1个回复     <<    >>    
 快速回复
  • 支持UBB,HTML标签

  • 高级回复

  • 操作选项:评分 加精 解精 奖惩 设专题 设公告 解公告 固顶 总固顶 解固顶 结帖 解结帖 锁帖 解锁 移帖 删帖
      首页 | 购买指南 | 虚拟主机 | 特色介绍 | 下载中心 | 支付方式
    Copyright 2004-2008 BBSGood.com Powered By: BBSGood.Speed Version 5.0
      咨询电话:0575-85513832、0575-85513825(传真)、7*24小时咨询服务:13606552007 不良信息举报中心 浙ICP备05029817号
      业务QQ:38958768、客服QQ1:415896239、客服QQ2:343896043、MSN:jccsxx@hotmail.com