【发布时间】:2016-10-16 10:56:56
【问题描述】:
我有一个用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' 字体!所有其他字体都可以正常工作。
【问题讨论】:
-
你能分享你的整个样式表吗?查看是否有任何规则覆盖了您的身体样式将很有用。
-
@Brayniverse 我添加了相关样式
-
很奇怪。可以给个链接看看吗?
标签: html css google-chrome fonts styles