如何将博客标题移动到屏幕中间?
我对博客很陌生。我的博客的标题描述位于左上角,但我希望它位于屏幕中间,博客的描述位于图像下方。
我尝试了以下代码,但标题仍然位于左上角:
<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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您还可以将
style="text-align: center"
放在 html 中的div class='titlewrapper'
旁边,它也会起作用。You can also put
style="text-align: center"
next todiv class='titlewrapper'
in html and it will work.您必须编辑 CSS 文件并设置
#titlewrapper { text-align: center }
或者,您可以在
style="text-align: center"
code>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.嗯,我明白了。标题用
包裹,默认情况下左对齐。所以将其 CSS 更改为
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 totext-align:center;
Use this
这对我来说效果很好
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;