position : static – 元素框正常生成。即上述不对元素进行任何样式设置的默认形态。 position : relative (此时设置top, right, bottom, left生效) – 相对于它的原点定位,元素仍保持其未定位前的形状,它原本所占的空间仍保留。 例如: 定位前: Read More
posted @ 2016-04-19 12:43 心然_may Views(3605) Comments(0) Diggs(0)
只有普通流和绝对定位的元素可以设置居中,浮动元素是不存在居中的。 水平居中:{ margin : 0 auto; } 水平、垂直居中:该元素{ margin: auto; top: 0; bottom: 0; left: 0; right: 0; overflow : auto },其父元素{ po Read More
posted @ 2016-04-19 12:30 心然_may Views(178) Comments(0) Diggs(0)