简体   繁体   English

Wordpress 主页未居中

[英]Wordpress home page not centered

Why is my "Page [0]" not centered in my webpage? 为什么我的“页面 [0]”没有在我的网页中居中?

is the closest I've found yet to the type of problem I'm having.是我发现的最接近我遇到的问题的类型。

The home page of my site is not centered.我网站的主页没有居中。 When you click on any secondary page it will center.当您单击任何辅助页面时,它将居中。

I have Googled at least 100 times for every article on centering a web page with CSS using several search terms.对于每篇关于使用多个搜索词将 web 页面与 CSS 居中的文章,我至少搜索了 100 次。 I have even replaced style.css with a freshly downloaded copy of the theme style.css file with no change.我什至用新下载的主题 style.css 文件副本替换了 style.css 文件,没有任何变化。

I fixed one custom template page that was doing the same thing by adding:我通过添加以下内容修复了一个执行相同操作的自定义模板页面:

<?php get_template_part( 'loop', 'page' ); ?>

I tried doing that with the home page but it still did not fix it.我尝试在主页上这样做,但它仍然没有修复它。 The home page will still not center.主页仍然不会居中。

The theme is supposed to be HTML5, I ran it through a validator and it gives errors for the rel statements, but that should eventually be fixed when they get the validator updated.主题应该是 HTML5,我通过验证器运行它,它给出了 rel 语句的错误,但最终应该在他们更新验证器时修复。 No relevant CSS seems to be a problem to the validator.没有相关的 CSS 似乎是验证器的问题。

When I do clear: left in #primary of the Layout section, it fixes the problem, but the right sidebar widget goes down the page.当我明确:留在布局部分的#primary 时,它解决了问题,但右侧边栏小部件在页面下方。

I also fixed the duplicate #wrapper entry that comes as a default with the Twenty Ten theme.我还修复了二十个主题默认出现的重复的#wrapper 条目。

I don't recall having the problem before the Wordpress 3.2.1 update, but then again I may not have noticed it.我不记得在 Wordpress 3.2.1 更新之前有这个问题,但是我可能没有注意到它。

It's the same in Firefox and IE. Firefox 和 IE 也是一样。

You can see it at http://www.danmctaggart.com您可以在http://www.danmctaggart.com看到它

It isn't programming related at all.它根本与编程无关。

Your homepage is not very tall, so it doesn't have a vertical scroll bar.你的主页不是很高,所以它没有垂直滚动条。 Your other pages are.你的其他页面是。 It seems like it isn't centered, but it's really just re-centering with the addition of a scroll bar on the right.看起来它没有居中,但实际上只是通过在右侧添加滚动条来重新居中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM