您的位置:首页 > Web前端 > CSS

div+css基础——6.采用div定位技术对div进行排版(绝对定位,不指定父容器)

2013-05-26 16:33 477 查看
<!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>采用div定位技术对div进行排版(绝对定位,脱离文档流)</title>
<meta name="keywords" content="自定义关键字"/>
<meta name="description" content="自定义描述"/>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<style type="text/css">
#father{
background-color:#FFFF99;
width:100%;
height:100px;
border:1px dashed green;
}
#son1{
position:absolute;	/*相对于浏览器边框定位*/
right:0;
}
#son2{

}
</style>
</head>
<body>
<div>
<div id="father">
<div id="son1">aaaaaaaaaa</div>
<div id="son2">bbbbbbbbbb</div>
<div id="son3">cccccccccc</div>
</div>
</div>
</body>
</html>


效果截图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐