老师relative设置right属性问题
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title >Document</ title > < style > .test{ width: 100px; height: 100px; background: red; position: relative; right: 0px; top: 0px; } </ style > </ head > < body > < div class = "test" ></ div > </ body > </ html > |
老师设置相对定位后。left:10px top:10px ,结果是距离左侧10个像素,距离上面10个像素,也就是块像右移动了。
那么我设置right:100px,top:100px 最后的结果不是应该这个块具体右侧100个像素,具体顶部100个像素,这个块在浏览器的右面么。为什么弄完块没了呢。如果我设置的像素小点的话,它是在左上角变小呢,没弄明白
2
收起
正在回答 回答被采纳积分+1
1回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧