【问题标题】:I'm trying to change line height and font-size using css but it is not working我正在尝试使用 css 更改行高和字体大小,但它不起作用
【发布时间】:2021-04-03 21:40:57
【问题描述】:

我正在尝试使用 css 更改行高和字体大小,但它不起作用

HTML 代码:

<h2>I no longer have to sniff other dogs for love. I've found the hottest Corgi on TinDog. Woof.</h2>

css代码:

h2{
  font-family: 'Montserrat', sans-serif;
  font-size: 10rem;
  line-height: 1.5;
}

output

【问题讨论】:

    标签: html css bootstrap-4


    【解决方案1】:

    它可以工作,但字体太大,所以文本不可见。 也许让文字变小?

    h2 {
        font-family: 'Montserrat', sans-serif;
        font-size: 1rem;
        line-height: 1.5;
    }
    

    【讨论】:

    • 是的,我这样做是因为我想要 3rem 的大小,但这不起作用,所以我将其更改为 10rem 以查看一些可见的变化,然后我注意到 LINE_HEIGHT 和 FONT_SIZE 属性都被取消了,如您所见在图像中。
    猜你喜欢
    • 1970-01-01
    • 2013-02-28
    • 1970-01-01
    • 2023-03-31
    • 2021-12-19
    • 1970-01-01
    • 1970-01-01
    • 2017-02-02
    • 2020-12-01
    相关资源
    最近更新 更多