我正在尝试将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>
答案 0 :(得分:1)
解决: 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");