84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
将内容区域的样式设置成这样,可以解决,可是在编码的时候也会有很多问题。
.element { width: 60px; height: 40px; position: absolute; left: 0; top: 0; right: 0; bottom: 0; margin: auto; /* 有了这个就自动居中了 */ border:1px solid red; }
有其他的方法吗
走同样的路,发现不同的人生
首先get一个新方法;我一般这样居中.element {
width: 60px; height: 40px;position: absolute; left: 50%; top: 50%;transform:translate(-50%,-50%);border:1px solid red;}
你需要:CSS布局之-水平垂直居中
看这里 http://f2e.souche.com/blog/jie-du-cssbu-ju-zhi-shui-ping-chui-zhi-ju-zhong/
首先get一个新方法;
我一般这样居中
.element {
width: 60px; height: 40px;
position: absolute;
left: 50%;
top: 50%;
transform:translate(-50%,-50%);
border:1px solid red;
}
你需要:CSS布局之-水平垂直居中
看这里 http://f2e.souche.com/blog/jie-du-cssbu-ju-zhi-shui-ping-chui-zhi-ju-zhong/