我有一个模式,我希望页码位于模式的底部并居中对齐。
页码绝对定位,底部为 0,居中对齐,文本对齐:
#pagination{
background: blue;
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
}
问题是,我将页码设置为 100% 宽度(因此它们可以居中对齐)但这考虑到了模态填充(我无法更改它),因此页码刚好偏离中心并且离开页面。
最佳答案
尝试将 left:0;
添加到您的代码中
#pagination {
background: none repeat scroll 0 0 blue;
bottom: 0;
left: 0;/*add this*/
position: absolute;
width: 100%;
}
关于html - 水平对齐底部和居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24756204/