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

css postion的两种属性学习 absolute 和 relative

2013-11-29 11:18 295 查看
<!DOCTYPE html>
<html>
<head>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<title>Dialog - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="js/themes/icon.css">

<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>

<style>
body{
margin:0px;
border:4px blue dotted;
height:600px;
}
#wrap{

width:500px;
background-color: red;
height:auto;
}
#column1{
position:absolute;
top:0px;
left:0px;
width:300px;
background-color: green;
}
#column2{
position:relative;
top:0px;
left:0px;
width:470px;
background-color: #FFFF66;
}
</style>
<body >

<div id="wrap">

<div id="column1">这里是第一列</div>
<div id="column2">这里是第二列</div>

</div>

</body>
</html>


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