Html 我们可以在标题标签中居中对齐文本吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8265449/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 11:40:28  来源:igfitidea点击:

Can we center align text in title tag?

htmlcss

提问by Bhabani Sankar Mishra

I have the following code -

我有以下代码 -

<html>
<head>
<title>Silly Title</title>    
</head>
<body>Silly Body</body>
</html>

How can I align the text in the title to center?

如何将标题中的文本居中对齐?

回答by Guffa

No, you can't format the title in any way.

不,您不能以任何方式格式化标题。

It's just information to the browser, that it will display outside the page itself. Typically it's shown in the name of the browser or on the tab for the page.

这只是浏览器的信息,它将显示在页面本身之外。通常,它显示在浏览器的名称中或页面的选项卡上。

回答by Bhabani Sankar Mishra

If you have your <title>in a <header>tag, you can use this:

如果你有你<title><header>标签,你可以使用这个:

<style>
header {
text-align: center;
}
</style>

回答by Minakshi

You can try this

你可以试试这个

          <Title><h2 align="center">Centered Heading</h2></Title>

I am not sure this will work or not but try..... Check this tutorial

我不确定这是否可行,但请尝试..... 检查本教程

http://www.tizag.com/htmlT/htmlattributes.php

http://www.tizag.com/htmlT/htmlattributes.php