请问各位dreamweaver中我想用position设置div的位置,是相对于body的,让这个div相对于body下移,怎么办

很急 希望知道的多多指点

应该用相对定位,而不是上面说的用绝对定位:

div{
postion:relative; //相对定位
top:80px; //向下移动100像素
}

使用相对定位后,设置的top值决定了div相对于原来所在的位置向下或向上移动。


温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-05-17
给div设置定位
div{
postion:absolut; //绝对定位

top:100px; //向下移动100像素

left:200px; //向右移动200像素

}追问

#header{
width:1000px;
height:600px;
position:absolute;
top:110px;

}
为什么不行呢

追答

#header{
width:1000px;
height:600px;
position:absolute;
top:110px;
background:red; //设置背景颜色为红色
}