最新消息:20210917 已从crifan.com换到crifan.org

【无法解决】html中设置title自动居中显示

HTML crifan 480浏览 0评论
折腾:
【已解决】electron中实现html的文本区域界面用于显示js中获取到的字符串
期间,此处html中,希望把标题
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Mitmdump代理保存URL</title>
...
<body>
  <h1>Mitmdump代理保存URL</h1>
中的title
实现居中显示
html title align center
html – Can we center align text in title tag? – Stack Overflow
html – Make heading center align – Stack Overflow
html – How do I center the post title? – Stack Overflow
然后发现:title是无法设置的。
而此处实际上想要居中显示的,不是title,而是h1
所以去设置h1为居中即可。
【总结】
  • html中
    • title无法设置居中显示
      • title是由浏览器控制渲染显示的,不受此处代码样式控制
    • 自己此处搞错了,其实是希望h1居中显示的:是可以的
      • 代码:
        •       h1 {
        •         text-align: center;
        •       }
      • 效果:

转载请注明:在路上 » 【无法解决】html中设置title自动居中显示

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
92 queries in 0.220 seconds, using 23.37MB memory