WordPress 主页未居中

发布于 2024-11-25 20:57:47 字数 847 浏览 4 评论 0原文

为什么我的“页面 [0]”没有居中我的网页?

是我发现的最接近我遇到的问题类型的网页。

我网站的主页未居中。当您单击任何辅助页面时,它将居中。

我在 Google 上搜索了至少 100 次关于使用多个搜索词使用 CSS 居中网页的文章。我什至将 style.css 替换为新下载的主题 style.css 文件副本,没有任何更改。

我通过添加以下内容修复了一个执行相同操作的自定义模板页面:

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

我尝试对主页执行此操作,但仍然没有修复它。主页仍然不会居中。

主题应该是 HTML5,我通过验证器运行它,它给出了 rel 语句的错误,但最终应该在验证器更新时修复。没有相关的 CSS 似乎对验证器来说是一个问题。

当我在“布局”部分的#primary 中执行“clear: left”操作时,它解决了问题,但右侧边栏小部件会在页面下方移动。

我还修复了“二十十”主题默认的重复 #wrapper 条目。

我不记得在 WordPress 3.2.1 更新之前有过这个问题,但我可能没有注意到它。

在 Firefox 和 IE 中也是一样的。

您可以在 http://www.danmctaggart.com 中查看它

Why is my "Page [0]" not centered in my webpage?

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. I have even replaced style.css with a freshly downloaded copy of the theme style.css file with no change.

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. No relevant CSS seems to be a problem to the validator.

When I do clear: left in #primary of the Layout section, it fixes the problem, but the right sidebar widget goes down the page.

I also fixed the duplicate #wrapper entry that comes as a default with the Twenty Ten theme.

I don't recall having the problem before the Wordpress 3.2.1 update, but then again I may not have noticed it.

It's the same in Firefox and IE.

You can see it at http://www.danmctaggart.com

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萤火眠眠 2024-12-02 20:57:47

它根本与编程无关。

你的主页不是很高,所以没有垂直滚动条。你的其他页面是。它看起来好像没有居中,但实际上只是通过在右侧添加一个滚动条来重新居中。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文