.yellow { position: relative; width: 300px; height: 300px; padding: 20px; background-color: yellow; } .blue { position: absolute; top:0; left: 0; width: 100px; height: 100px; background-color: blue; }
不受影响,起点依然是整个盒子的边角,而不是padding后的内容边角
标签:定位,盒子,--,100px,yellow,padding,color From: https://www.cnblogs.com/ericyjchung/p/16852107.html