一、开启绝对定位后的水平布局
开启绝对定位后,水平布局的等式需要添加left和right两个值,即变成:
left+margin-left+border-left+padding-left+width+padding-right+border-right+margin-right+right=父元素内容区的宽度
二、变化
当发生过度约束时,若9个值中没有auto则自动调整right以使等式满足;若9个值中有auto则会调整auto的值以使等式满足
注意:1、left和right的默认值就是auto
2、可以设置auto的值:margin、width、left、right
三、开启绝对定位后的垂直布局
top+margin-top+border-top+padding-top+height+padding-bottom+border-bottom+margin-bottom+bottom=父元素内容区的高度
四、应用
margin:auto;
left:0;
right:0;
top:0;
bottom:0;
让元素在其父元素内居中