我在用字体库。我想把箭头图标水平居中。div必须是绝对位置。
我用这个代码,但它不起作用。
.arrow {
left: 0;
right: 0;
}
JSFiddle Demo
最佳答案
在绝对值中使用width:100%
.home .center {
position: absolute;
bottom: 0;
top:30px;
text-align: center;
width:100%;
}
更新fiddle
我在用字体库。我想把箭头图标水平居中。div必须是绝对位置。
我用这个代码,但它不起作用。
.arrow {
left: 0;
right: 0;
}
最佳答案
在绝对值中使用width:100%
.home .center {
position: absolute;
bottom: 0;
top:30px;
text-align: center;
width:100%;
}