Loading...
  所在位置:论坛首页 -> ┈┋电脑网络技术区┋┈ -> 网页制作技术 -> 三栏式带滚动条自动伸展的DIV+CSS布局示例
标题:三栏式带滚动条自动伸展的DIV+CSS布局示例收藏 编辑 删除 楼主 | 上一篇 下一篇
疯狂石头
等级:社区游侠
权限:普通用户
积分:37
金钱:2977
声望:54
经验:54
发帖数:713
注册:2007年10月21日
资料 短消息2008-4-20 10:51:08

自动伸缩效果.

以下是代码:
<html>
<head>
<title>Nice and Free CSS Template 3</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: 22%;
top: 106px;
background-color: #ffffff;
}
#content {
position: absolute;
left: 25%;
width: 50%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
#right {
position: absolute;
left: 76%;
width: 22%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
#right, #content, #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: 22%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>Attention</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 />
</p>
<br />
<br />
</div>
<div id="content">
<h3>middle right</h3>
<pre>
#content {
position: absolute;
left: 25%;
width: 50%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
</pre>
<h3>overflow: auto;</h3>
<p>With overflow: auto;
With overflow: you can determine how overflowing content should be treated.</p>
<h3>Values</h3>
<pre>
visible = The element gets expanded to show the entire content.
hidden  = The content will be cut if it overflows.
scroll  = The browser should offer scroll bars.
auto    = The browser should decide how to render the element. Scroll bars are allowed.
</pre>
<p>Older browsers do not know support this property.<br />
IE does not support overflow:visible</p>
<br />
<br />
</div>
<div id="right">
<h3>right</h3>
<pre>
#right {
position: absolute;
left: 76%;
width: 22%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
</pre>
<h3>open code</h3>
<p>Use of this code encouraged! (o_.)/</p>
<br />
<br />
</div>
</body>
</html>

以下是HTML脚本特效代码,点击运行按钮可查看效果:
<html>
<head>
<title>Nice and Free CSS Template 3</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: 22%;
top: 106px;
background-color: #ffffff;
}
#content {
position: absolute;
left: 25%;
width: 50%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
#right {
position: absolute;
left: 76%;
width: 22%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
#right, #content, #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: 22%;
top: 106px;
background-color: #ffffff;
}
</pre>
<h3>Attention</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 />
</p>
<br />
<br />
</div>
<div id="content">
<h3>middle right</h3>
<pre>
#content {
position: absolute;
left: 25%;
width: 50%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
</pre>
<h3>overflow: auto;</h3>
<p>With overflow: auto;
With overflow: you can determine how overflowing content should be treated.</p>
<h3>Values</h3>
<pre>
visible = The element gets expanded to show the entire content.
hidden  = The content will be cut if it overflows.
scroll  = The browser should offer scroll bars.
auto    = The browser should decide how to render the element. Scroll bars are allowed.
</pre>
<p>Older browsers do not know support this property.<br />
IE does not support overflow:visible</p>
<br />
<br />
</div>
<div id="right">
<h3>right</h3>
<pre>
#right {
position: absolute;
left: 76%;
width: 22%;
top: 106px;
background-color: #ffffff;
overflow: auto;
}
</pre>
<h3>open code</h3>
<p>Use of this code encouraged! (o_.)/</p>
<br />
<br />
</div>
</body>
</html>

2008-4-20 10:51:08 顶部
第1页 共页 共0个回复     <<    >>    
 快速回复
  • 支持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