為什么position的left是200px的時(shí)候是貼在網(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
舉報(bào)
2016-07-11
剛提問完就知道為什么了.......
因?yàn)閟pan的位置是以div1為參考標(biāo)準(zhǔn)的(absolute以據(jù)其最近的已定位祖先元素為偏移參照基準(zhǔn)).div寬度為200px,left:200px剛剛好實(shí)在div1的右邊.