【问题标题】:change color of title in html更改html中标题的颜色
【发布时间】:2020-05-13 14:31:01
【问题描述】:

有什么方法可以改变 HTML 本身中标题的字体颜色吗? 我试过这个

<style>
    title {color:red}
</style> 

但是没有用。

【问题讨论】:

  • 你无法控制页面标题的显示
  • 所以,我不能在标题部分做任何事情。

标签: html colors titlebar


【解决方案1】:

我从未见过任何可用于标题文本的样式,但是您当然可以在某些浏览器和移动设备中更改标题栏的颜色。使用以下元标记来实现这一点。

对于 Chrome、Firefox 和 Opera: 对于 Windows 手机设备:

<meta name="msapplication-navbutton-color content="COLOR_HEX_CODE">

对于 iPhone 设备和 Safari,您只能使用以下内容:

  1. 黑色
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
  1. 默认
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
  1. 半透明黑色
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

【讨论】:

    【解决方案2】:

    &lt;title&gt;&lt;/title&gt; 定义 HTML 文档的名称。因为它只显示在浏览器的标题栏和搜索引擎中,所以您无法设置它的样式。

    【讨论】:

    • And if you could edit it, it needs to look like this 你能详细说明为什么它应该被内联还是在样式标签中定义?
    • 对不起。我没有正确阅读问题中的代码。将编辑我的答案。
    猜你喜欢
    • 2020-04-30
    • 1970-01-01
    • 2022-09-28
    • 2015-11-11
    • 1970-01-01
    • 1970-01-01
    • 2019-04-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多