无法将输入提交按钮上的文本样式设置为粗体? [英] Can't style text on input submit button as bold?

查看:105
本文介绍了无法将输入提交按钮上的文本样式设置为粗体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将输入按钮中的字体设置为粗体。



以下是我的代码:

 < 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;.

这篇关于无法将输入提交按钮上的文本样式设置为粗体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆