如何将博客标题移动到屏幕中间?

发布于 2024-10-05 02:49:56 字数 205 浏览 0 评论 0原文

我对博客很陌生。我的博客的标题描述位于左上角,但我希望它位于屏幕中间,博客的描述位于图像下方。

我尝试了以下代码,但标题仍然位于左上角:

<title style="text-align:center"><data:blog.pageTitle/></title>

提前致谢。

I am very new to blogging. My blog has its title description at the top-left but I want it to be in the middle of the screen and the description of the blog beneath the image.

I tried the following code but the title is still at the top-left corner:

<title style="text-align:center"><data:blog.pageTitle/></title>

Thanks in advance.

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

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

发布评论

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

评论(5

何以心动 2024-10-12 02:49:57

您还可以将 style="text-align: center" 放在 html 中的 div class='titlewrapper' 旁边,它也会起作用。

You can also put style="text-align: center" next to div class='titlewrapper' in html and it will work.

她比我温柔 2024-10-12 02:49:56

</code> 元素不用于网站上显示的标题,仅用于浏览器顶部栏中的标题。

您必须编辑 CSS 文件并设置 #titlewrapper { text-align: center }

或者,您可以在 style="text-align: center" code>

在 HTML 中。

The <title> element isn't used for the title displayed on your website, only for the title in the browser's top bar.

You'll have to edit the CSS file and set #titlewrapper { text-align: center }

Alternatively you can add style="text-align: center" in the <div id='titlewrapper'> in your HTML.

做个少女永远怀春 2024-10-12 02:49:56
<div style="text-align:center">Title of your blog</div>
<div style="text-align:center">Title of your blog</div>
仙气飘飘 2024-10-12 02:49:56

嗯,我明白了。标题用

包裹,默认情况下左对齐。所以将其 CSS 更改为 text-align:center;

使用此

#titlewrapper h1 { text-align:center; }

Well, I got it. The title is wrapped with a <h1> which is by default aligned at the left. so change it's CSS to text-align:center;

Use this

#titlewrapper h1 { text-align:center; }
羁客 2024-10-12 02:49:56

这对我来说效果很好
STEP1:仪表板>模板>编辑 HTML
STEP2:按Ctrl+F在编辑器中搜索以下标题代码:.Header h1 {
STEP3:保存您的工作并刷新页面
中间

博客标题现在应该位于页面
- 这是我添加的代码:text-align: center;
您还可以在博客标题代码下方的说明中添加相同的代码,以使其居中对齐。以下是您应在编辑器中搜索的描述代码:.Header .description {
在其中添加相同的代码text-align: center;

This worked well for me
STEP1: Dashboard > Tepmlate > Edit HTML
STEP2:Search in the editor by pressing Ctrl+F for the following headercode:.Header h1 {
STEP3: Save your work and refresh the page
THE BLOG TITLE SHOULD NOW BE IN THE MIDDLE OF THE PAGE

BONUS
- Here is the code I added: text-align: center;
You can also add the same code in the description below your blog title code to align it at the center. Here is the description code you should search for in the editor: .Header .description {
Add the same code in it text-align: center;

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