无法让我的页脚内容居中

Can't get my footer content to center

我希望从 CSS 高手那里得到一些启发。查看 http://oicjapan.org 处任何页面的底部 - address/phone 信息部分在页面中央看起来会好很多,但我似乎无法将其转到那里。在 aside#footer-sidebardiv#fsidebar 上设置 text-align:center 只是让文本在 <li> 内居中,而整个内容位于 #wrapper 的左侧。 margin-left:auto; margin-right:auto; 对我尝试过的几个元素(#footer-sidebar#fsidebar#fsidebar-ul)中的任何一个都没有任何可见的影响。

我不限于 CSS 更改 - 如果标记需要更改,我可以做到。

如果您希望块以页面为中心,则需要为 #fsidebar 添加宽度,例如:

#fsidebar {
    margin: 0 auto; // does the same thing as margin-left: auto; margin-right: auto;
    width: 400px;
}

如果您希望该块与网页的右栏内联移动,为什么不只是在该块上留边距/填充呢?大致如下:

#fsidebar {
    margin-left: 350px; // use whatever looks to your liking
}

#hsidebar .widget-container, #fsidebar .widget-container 中删除 float:left; 或者您可以使用以下方法覆盖此规则:

#fsidebar #text-4 {
    float: none;
    text-align: center;
}

然后,从 #fsidebar #text-4 .textwidget > div > div 中删除 float:left; 或用此规则覆盖它:

#fsidebar #text-4 .textwidget > div > div {
    display: inline-block;
    float: none !important;
}

希望这能奏效!

您好,这是将您网站上的页脚文本居中的代码,

#fsidebar {
text-align: center;
}

.widget-container {
margin: 5.0%; 
}