我这里的绝对定位为什么不能用top?
<!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>无标题文档</title> <style type="text/css"> *{margin:0; padding:0;} #wrap{width:970px; 【任务1】 margin:0 auto;} #mainbody{【任务3】position:relative; margin-top:15px;} #left{【任务2】width:110px; float:left; margin-top:10px;} #mid{【任务2】width:650px;border:1px solid #999; float:left; margin:13px;} #right{【任务3】position:absolute; top:50px; border:1px solid #999;}<!--这里为什么不能用top属性,而要用margin-top?--> </style> </head> <body> <div id="wrap"> <div id="header"><img src="http://img1.sycdn.imooc.com//5369cd6e0001a15b09700088.jpg" width="970" height="88" /></div> <div id="mainbody"> <div id="left"><img src="http://img1.sycdn.imooc.com//5369cd0e00011e3901090487.jpg" width="109" height="487" /></div> <div id="mid"><img src="http://img1.sycdn.imooc.com//5369cd3c00013e9e06490439.jpg" width="649" height="439" /></div> <div id="right"><p>欢迎使用金山软件出品的爱词霸,在线查询你英语词汇、句子释义</p><img src="http://img1.sycdn.imooc.com//5369cd540001d8e101770329.jpg" width="177" height="329" /></div> </div> </div> </body> </html>
#right{【任务3】中为什么不能用top属性,而要用margin-top?