我有一个用 HTML
编写的网页,其中我有一个 button
。所有页面均尊重font-family: 'PT Sans', sans-serif
除了我的按钮。
body {
font-family: 'PT Sans', sans-serif;
margin: 0px 0px 0px 0px;
}
这是表格内的按钮元素:
<button id="createCampaignButton" class="yellowButton" nowrap>CREATE NEW CAMPAIGN</button>
我还使用过<style>
像下面这样的标签,它会改变字体颜色,但不会改变字体系列。
button {
font-family: 'PT Sans', sans-serif;
color: red
}
我在这里搜索过,但没有一个适合我。
我的样式表:
<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
.yellowButton {
border: 0 solid #FFCC00;
width:100%;
/*height: 50px;*/
font-size: 16px;
font-weight: bold;
background-color: #FFCC00;
padding: 12px 20px;
box-shadow: 0 2px 2px 0 #C2C2C2;
border-radius: 2px;
outline:none;
}
.yellowButton:active {
border: 0 solid #FFCC00;
width:100%;
/*height: 50px;*/
font-size: 16px;
font-weight: bold;
background-color: #FFCC00;
padding: 12px 20px;
box-shadow: 0 0 0 0 #C2C2C2;
border-radius: 2px;
outline: none;
}
更新
现在我注意到问题只出在 'PT Sans'
上。字体!所有其他字体都工作正常。
最佳答案
你有包含这个文件吗?
<link href='https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
如果不只是在标题中过去。
或者如果你想在CSS中,使用这个
@import url(https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic);
关于html - chrome 不尊重字体系列 ('PT Sans' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37833531/