idv+css横向布局绝对定位
2011-06-16 07:17
288 查看
<!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>绝对定位css布局实例</title>
<style>
body
{
margin:0;
}
#header
{
position:absolute;
top:2px;
left:5px;
height:80px;
width:780px;
}
#nav
{
position:absolute;
top:87px;
left:5px;
height:400px;
width:180px;
}
#content
{
position:absolute;
top:87px;
left:195px;
height:400px;
width:590px;
}
#footer
{
position:absolute;
top:492px;
left:5px;
height:80px;
width:780px;
}
div
{
border:2px solid #000000;
}
</style>
</head>
<body>
<div id="header">header部分</div>
<div id="nav">绝对定位的nav部分</div>
<div id="content">绝对定位的内容部分</div>
<div id="footer">footer部分</div>
</body>
</html>
"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>绝对定位css布局实例</title>
<style>
body
{
margin:0;
}
#header
{
position:absolute;
top:2px;
left:5px;
height:80px;
width:780px;
}
#nav
{
position:absolute;
top:87px;
left:5px;
height:400px;
width:180px;
}
#content
{
position:absolute;
top:87px;
left:195px;
height:400px;
width:590px;
}
#footer
{
position:absolute;
top:492px;
left:5px;
height:80px;
width:780px;
}
div
{
border:2px solid #000000;
}
</style>
</head>
<body>
<div id="header">header部分</div>
<div id="nav">绝对定位的nav部分</div>
<div id="content">绝对定位的内容部分</div>
<div id="footer">footer部分</div>
</body>
</html>
相关文章推荐
- CSS学习笔记:使用绝对定位实现横向两列布局
- CSS布局之脱离文档流详解——浮动、绝对定位脱离文档流的区别
- 【CSS布局.2】绝对定位和相对定位
- 【CSS】 布局之浮动float和绝对定位absolute的选择
- CSS分栏布局的方法:绝对定位和浮动
- CSS:网页混合布局,浮动,绝对定位,相对定位
- 怎么给网页写一个侧栏(横向两列布局-使用绝对定位和相对定位的方法)
- css布局:父元素相对定位,子元素绝对定位
- CSS布局:浮动与绝对定位的异同点
- CSS:绝对定位布局案例 position布局实例
- Div+CSS教程----DivCSS布局绝对定位和浮动
- CSS布局之脱离文档流详解——浮动、绝对定位脱离文档流的区别
- CSS分栏布局的方法:绝对定位和浮动
- css 绝对定位整页布局演示
- css布局绝对定位下margin失效的解决方法
- css 布局之定位 相对/绝对/成比例缩放
- Div+CSS教程----DivCSS布局绝对定位和浮动
- 图解DIV-CSS布局中绝对定位和浮动用法(两种分三栏布局的方法)
- CSS布局之脱离文档流详解——浮动、绝对定位脱离文档流的区别
- CSS教程:相对、绝对定位及布局和浮动