html - 标签 css 不适用于 'a' 标签中的文本

标签 html css

我正在尝试将 gotham 字体应用于我的按钮,但似乎没有任何效果,当我检查正在运行的索引并转到该元素时,它显示字体系列为 gotham ,但文本看起来不像 gotham .不确定我在这里做错了什么。

CSS:

@font-face {
    font-family: 'Gotham';
    src: url("assets\fonts\Gotham-Bold.otf") format('embedded-opentype');
    src: url("assets\fonts\Gotham-Light.otf") format('embedded-opentype');
}

a:link, a:visited {
        font-family: Gotham;
        text-align: right;
        color: white;
        background: #005870;
        border: none;
        padding: 15px;
        font-size: 2rem;
        margin-top: 10px;
        cursor: pointer;
        position: absolute;
        right: 65%;
        transition: .4s;
        text-decoration: none;
}


a:hover, a:active {
        font-size: 2.5rem;
        color: #005870;
        background: white;
        transition: .4s;
        text-decoration: none;
}

HTML:

<div id="h1s" style="background:transparent;">
    <img src = "environmental-care.jpg" id="frame"/>

    <div class="h1padding"></div>
    <a class = "h1" href="" id="introID">Intro</a>

    <div class="h1padding"></div>
    <a class = "h1" href=""><b>ON THE</b> <span class="light">SURFACE</span></a>

    <div class="h1padding"></div>
    <a class = "h1" href=""><b>FROM</b> <span class="light">ORE TO OIL</span></a>

    <div class="h1padding"></div>
    <a class = "h1" href=""><b>ENVIRONMENTAL</b> <span class="light">CARE</span></a>

    <div class="h1padding"></div>
    <a class = "h1" href=""><b>MUCH MORE THAN</b> <span class="light">GASOLINE</span></a>

    <div class="h1padding"></div>
    <a class = "h1" href=""><b>ONE MORE</b> <span class="light">THING</span></a>
    <br><br>
    <div class="h1padding"></div>
    <div class="h1padding"></div>
</div>

最佳答案

已解决: Chrome 不关心格式,删除它并且它正在工作:)

src: url("assets\fonts\Gotham-Bold.otf") format('embedded-opentype');
src: url("assets\fonts\Gotham-Light.otf") format('embedded-opentype');

改为:

src: url("assets\fonts\Gotham-Bold.otf");    
src: url("assets\fonts\Gotham-Light.otf");

关于html - 标签 css 不适用于 'a' 标签中的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46590300/

相关文章:

html - CSS Box Shadow 不适用于 iPhone

css背景透明

html - 在 CSS 中自动调整倾斜背景(+ 图像?)

javascript - 我的 html 页面上的 google maps api 位置错误

javascript - 在 href 属性中使用 "#"的替代方法

html - 如何调整容器大小以适应其子项的宽度

html - 如何将2个div(重叠)水平居中

jQuery 在图像之间切换

javascript - 为什么这 block Canvas 会不断增长? (动态调整 Canvas 大小)

html - 文本区域下的额外填充