比如left=100,top=100,weidth=100,height=100,background-color=black,那么div元素会较高一些,而dl元素会较低,二者位置并不相同。
为什么会这样?
dl默认有上下margin的,div没有,所以位置会不一样。高度一样,只是由于margin的问题导致dl往下了16px
dl
div
去掉默认的margin后就一样了
<!doctype html>
<style>
.test{left:100px;top:100px;width:100px;height:100px;background-color:#000;position:absolute;margin:0}
</style>
<dl class=test>
</dl>
<div class="test" style="left:250px"></div>
dl是在div标签内的吗。标签之间存在内边距和外边距