【问题标题】:I have a problem changing the inside of h1 to #f50569 color将 h1 的内部更改为 #f50569 颜色时遇到问题
【发布时间】:2020-07-20 12:02:37
【问题描述】:

这是我工作的屏幕截图,[1]:https://i.stack.imgur.com/IWbDJ.png,我在填充“收养我”的 h1 时遇到问题,我使用的是一种名为“Londrina Shadow”的谷歌字体,我想填充用这个颜色“#f50569”,我还是个初学者,所以我真的需要你的帮助。

谢谢。

h1
{
    font-family: 'Londrina Shadow', cursive;
    font-size: 60px;
    : #f50569;
}

【问题讨论】:

  • : #f50569; 这是错字还是您的实际代码?
  • 您选择的字体仅由轮廓组成。您将无法用颜色填充字符的内部

标签: css colors


【解决方案1】:

'Londrina Shadow' 字体仅包含轮廓。无法用颜色填充轮廓之间的空白空间,因为这些区域不是字体字形的一部分。

但是,还有另一种字体; 'Londrina Solid',形状相同,但外观坚固,而不是轮廓。

您可以将这两种字体分层以创建填充和轮廓效果。

h1 {
  font-family: 'Londrina Solid', cursive;
  color: orange;
  font-size: 50px;
  position: relative;
}

h1:after {
  content: "Lorem ipsum";
  font-family: 'Londrina Shadow', cursive;
  color: black;
  position: absolute;
  left: 0;
  top: 0;
}
<link href="https://fonts.googleapis.com/css2?family=Londrina+Shadow&family=Londrina+Solid&display=swap" rel="stylesheet">

<h1>
  Lorem ipsum
</h1>

【讨论】:

    【解决方案2】:

    你的意思是使用color:#f50569;

    h1
    {
        font-family: 'Londrina Shadow', cursive;
        font-size: 60px;
        color: #f50569;
    }
    &lt;h1&gt;Adopt Me&lt;/h1&gt;

    【讨论】:

    • 我的意思是在这个词里面
    【解决方案3】:

    要设置文本颜色,请使用colorattribute:

    h1
    {
        font-family: 'Londrina Shadow', cursive;
        font-size: 60px;
        color: #f50569;
    }
    

    这是你想要的吗?

    【讨论】:

    • 其实不是,我不是在寻找文本颜色,而是在寻找内部
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-15
    • 2016-04-21
    • 1970-01-01
    • 2014-10-22
    • 2016-04-12
    • 1970-01-01
    相关资源
    最近更新 更多