gpt4 book ai didi

html - 如何修改 Font-Awesome 中的文本?

转载 作者:太空宇宙 更新时间:2023-11-03 21:29:28 25 4
gpt4 key购买 nike

<i class="fa fa-envelope fa-lg">
robfran@gmail.com
</i>

我有以下代码。如何更改“example@gmail.com”的字体类型?

最佳答案

我假设您想要一种不是 Font-Awesome 的字体。

做这样的事情:

HTML

<i class="fa fa-envelope fa-lg"></i><span class="email_font">example@gmail.com</span>

CSS

span.email_font {
font-family: "Times New Roman", Georgia, Serif !important;
}

Times New Roman 是您的电子邮件地址所使用的字体,而 Georgia 和 Serif 是备用字体,以防 Times New Romans 未在计算机/浏览器/移动设备上加载

您还可以指定font-style:(可以是普通、斜体和倾斜),font-weight:(可以是普通、粗体或数字) 和 font-size:(以 px 为单位的数字,或 % 等)。还有其他的,但这些是基础知识。

所以我们可以做

span.email_font {
font-family: "Times New Roman", Georgia, Serif !important;
font-style: italic !important;
font-weight: bold !important;
font-size: 15px !important;
}

这将为您提供 Times New Roman 的电子邮件,斜体、粗体和 15px 的大小。我添加了 !important 以确保实现这些样式。

如果你想做内联来简化,认为这是不推荐的。

<i class="fa fa-envelope fa-lg"></i>
<span style="font-family: 'Times New Roman', Georgia, Serif; font-style: italic; font-weight: bold; font-size: 15px ;">example@gmail.com</span>

关于html - 如何修改 Font-Awesome 中的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30490859/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com