首页
关于我们
网站建设
经典案例
网络推广
技术中心
建站指导
联系我们
网站套餐 Package
最新推荐 Recommended  
  您现在的位置: 天诚世纪 >> 技术中心 >> 网页设计 >> WEB标准 >> 正文
CSS中最基本的外框架
作者:天诚世纪 更新时间:2009-6-22 17:07:04 来源:天诚世纪
    
以下为引用的内容:
<!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>
<title>css基本布局方法</title>
<style type="text/css">
*
{
font-size:12px;
font-family:verdana;
margin:0px;/*--定义元素周围的空间*/
padding:0px;/*--定义元素边框与元素内容之间的空白*/
}
#body
{
position:relative;
width:85%;
margin:3px auto;/*上下,左右,这里的左右就是居中*/
height:100%;
}
#sidebar /*左边*/
{
position:absolute;
left:0;
top:0;
width:200px;
}
#right
{
width:240px;
position:absolute;
right:0;
top:0;
}
#center
{
margin:0 241px 0 201px;/*上右下左*/
}
#header,#footer
{
width:85%;
margin:0 auto;/*由浏览器设置*/
height:50px;
}
#sidebar,#right,#center,#header,#footer{border:solid 1px #000;}
#sidebar,#right,#center{height:780px;}
</style>
</head>
<body>
<div id="header">head</div>
<div id="body">
<div id="sidebar">left<br />left<br /></div>
<div id="center">center</div>
<div id="right">right</div>
</div>
<div id="footer">footer</div>
</body>
</html>
本文链接:http://www.tc-21.com/ITCenter/200906/20090622170704.html

  • 上一篇文章:
  • 下一篇文章:
  •   更多关于WEB标准的新闻
      相关文章
    DIV与TABLE的区别
    浏览器不能正常解析CSS代码的解决
    HTML与javascript中常用编码浅析
    用CSS3 实现未来的Web
    DIV+CSS网页布局及网站设计常犯错误
    HTML5与HTML4的区别
    CSS布局实例:上中下三行 中间自适应
    CSS常用技巧介绍