问题描述
我试图将输入按钮中的字体设置为粗体。
以下是我的代码:
< input type =submit id =nm-matchclass =nm-buttonvalue =Match/>
这是我的CSS:
.nm-button {
text-transform:uppercase;
padding:5px;
color:blue;
font-weight:bold;
}
除粗体外,所有样式都应用。
这是一个JSFiddle显示问题:
您是否为MacOS使用Chrome?如果是这样,请尝试向按钮添加背景颜色以查看是否可以修复它。默认的Aqua风格可能是干扰。您还可以尝试 -webkit-appearance:none;
或 -webkit-appearance:button;
。
I'm trying to style the font in an input button as bold.
Here's my code:
<input type="submit" id="nm-match" class="nm-button" value="Match" />
Here's my CSS:
.nm-button {
text-transform: uppercase;
padding: 5px;
color: blue;
font-weight: bold;
}
All the styles are being applied apart from the bold.
Here's a JSFiddle showing the problem: http://jsfiddle.net/CJg43/1/
UPDATE: Why the close votes? Here's a screenshot of how it looks for me, in Chrome on MacOS:
UPDATE 2: ... and for comparison, here's how it looks with the solution (background-color: white
) applied - http://jsfiddle.net/CJg43/23/
Are you using chrome for a MacOS? If so, try adding a background-color to the button to see if it fixes it. The default Aqua styles might be interfering. You can also try -webkit-appearance: none;
or -webkit-appearance: button;
.
这篇关于无法将输入提交按钮上的文本样式设置为粗体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!