【问题标题】:@font face, calling a font-family works for one class but not for another, why?@font face,调用字体系列适用于一个类,但不适用于另一个类,为什么?
【发布时间】:2021-07-18 23:24:13
【问题描述】:

如标题中所述。我花了一些时间在客户的网站上实现特定的字体。我主要在我需要的所有 css 类上实现了字体。

以某种方式在定义菜单链接的“a”类上调用字体不起作用。为什么?

见截图12

例如,在“div.powered-by”类(也像链接一样工作)上它可以工作,而在“a”类(定义菜单链接)上它不能。查看屏幕截图。

调用字体不起作用:

div.powered-by 调用字体的工作原理:

【问题讨论】:

    标签: css wordpress font-face font-family


    【解决方案1】:

    因为以下行在您的字体系列之前运行

    --primary-nav--font-family: var(--global--font-secondary);
    

    你可以使用 !important

    a {
        font-family: 'Lemon Sans Uni Regular', Arial, sans-serif !important;
    }
    

    【讨论】:

    • 谢谢。那行得通。当我想以某种颜色制作选定的页面链接时,你能告诉我需要调用什么类吗?
    • 你当前所在的页面 .primary-navigation .current-menu-item > a:first-child, .primary-navigation .current_page_item > a:first-child
    猜你喜欢
    • 1970-01-01
    • 2014-01-21
    • 2017-06-20
    • 1970-01-01
    • 2014-01-06
    • 2021-12-10
    • 2013-03-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多