絕對(duì)定位和相對(duì)定位問題
第一種方法里,為什么要把demo01設(shè)置為絕對(duì)定位,設(shè)置span為相對(duì)定位,"十分鐘前才會(huì)移到上面去"?直接對(duì)span設(shè)置絕對(duì)定位為什么不行??
#demo01{width:600px;position:relative;} #demo01?.left{width:100px;float:left;} #demo01?.left?img{margin-left:20px;} #demo01?.right{width:458px;padding:20px;float:right;background:#99ccfd;border:1px?solid?#ccc;} #demo01?.right?p{font-size:12px;line-height:25px;} #demo01?.right?span{font-size:12px;position:absolute;right:20px;top:10px;}
2017-04-01
使span相對(duì)于demo01進(jìn)行定位,直接對(duì)span設(shè)置absolute是相對(duì)于body進(jìn)行定位