Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 水平对齐底部和中心?_Html_Css - Fatal编程技术网

Html 水平对齐底部和中心?

Html 水平对齐底部和中心?,html,css,Html,Css,我有一个模态,我希望页码在模态的底部,并且居中对齐 页码以底部0绝对定位,以文本对齐居中: #pagination{ background: blue; position: absolute; bottom: 0; width: 100%; text-align: center; } 问题是,我将页码设置为100%宽度(因此可以居中对齐),但这考虑了模态填充(我无法更改此设置),因此页码偏离了中心,偏离了页面 尝试添加左侧:0向您发送代码 #pagination {

我有一个模态,我希望页码在模态的底部,并且居中对齐

页码以底部0绝对定位,以文本对齐居中:

#pagination{

  background: blue;
  position: absolute;
  bottom: 0;
  width: 100%;
  text-align: center;  
}
问题是,我将页码设置为100%宽度(因此可以居中对齐),但这考虑了模态填充(我无法更改此设置),因此页码偏离了中心,偏离了页面


尝试添加
左侧:0向您发送代码

#pagination {
    background: none repeat scroll 0 0 blue;
    bottom: 0;
    left: 0;/*add this*/
    position: absolute;
    width: 100%;
}

尝试添加
左侧:0向您发送代码

#pagination {
    background: none repeat scroll 0 0 blue;
    bottom: 0;
    left: 0;/*add this*/
    position: absolute;
    width: 100%;
}

添加
左:0
以及
底部:0
位置:绝对
如下

CSS:

#pagination {
    background: blue;
    position: absolute;
    bottom: 0;
    width:100%;
    left:0;
}

添加
左:0
以及
底部:0
位置:绝对
如下

CSS:

#pagination {
    background: blue;
    position: absolute;
    bottom: 0;
    width:100%;
    left:0;
}

而不是使用
宽度:100%尝试使用

#pagination{   
    background: blue;
    position: absolute;
    bottom: 0;
    left:0; 
    right:0;
}


通过这种方式,如果需要,您可以在
#pagination
中添加填充,而不是使用
宽度:100%尝试使用

#pagination{   
    background: blue;
    position: absolute;
    bottom: 0;
    left:0; 
    right:0;
}


通过这种方式,如果需要

将左侧和右侧位置添加到0并删除宽度css,则可以在
#分页
中添加填充

#pagination{
left: 0;
right: 0;
}

将左右位置添加到0并删除宽度css

#pagination{
left: 0;
right: 0;
}

谢谢,但分页不再居中对齐@panthro小提琴的中心对齐了吗?尝试将
文本对齐:居中
添加到
#分页
,您似乎没有将该样式包含在原始小提琴中,但您在问题的代码中添加了该样式,可能它没有保存,抱歉,如果没有,是否有居中对齐的方法?谢谢,但分页不再居中对齐@panthro小提琴的中心对齐了吗?尝试将
text align:center
添加到
#pagination
,您似乎没有将该样式包含在原始小提琴中,但您在问题中的代码中包含了该样式,可能它没有保存,如果没有,很抱歉,有没有居中对齐的方法?谢谢,但是分页不再居中对齐要对齐文本,请添加文本对齐:居中;谢谢,但是分页不再居中对齐要对齐文本,请添加文本对齐:居中;谢谢,但是分页不再是居中对齐的,但是分页不再是居中对齐的,但是分页不再是居中对齐的,但是分页不再是居中对齐的