我正在尝试将 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/