為什么position的left是200px的時候是貼在網(wǎng)頁邊緣的?
#div1?span{
width:20px;
height:50px;
background:blue;
position:?absolute;
left:200px;
top:75px;
}為什么設(shè)置left:200px是剛好貼在網(wǎng)頁邊緣呢?而不是left:0px?
#div1?span{
width:20px;
height:50px;
background:blue;
position:?absolute;
left:200px;
top:75px;
}為什么設(shè)置left:200px是剛好貼在網(wǎng)頁邊緣呢?而不是left:0px?
2016-07-11
舉報
2016-07-11
剛提問完就知道為什么了.......
因為span的位置是以div1為參考標準的(absolute以據(jù)其最近的已定位祖先元素為偏移參照基準).div寬度為200px,left:200px剛剛好實在div1的右邊.