码迷,mamicode.com
首页 > 其他好文 > 详细

相对定位和绝对定位

时间:2016-03-12 17:21:13      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5 <title>无标题文档</title>
 6 </head>
 7 
 8 <body>
 9 
10 <div class="bbb"><div class="aaa"></div></div>
11 
12 <style>
13 
14 .aaa
15 {
16     width:100px;
17     height:50px;
18     background-color:#F00;
19     position:relative;
20     left:300px;
21                     
22 }
23 
24 .bbb
25 {
26     width:500px;
27     height:300px;
28     background-color:#0F0;
29     position:absolute;
30 }
31 
32 </style>
33 </body>
34 </html>

技术分享

相对定位和绝对定位

标签:

原文地址:http://www.cnblogs.com/sihuiming/p/5269212.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!