Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
841 views
in Technique[技术] by (71.8m points)

css - Can't style text on input submit button as bold?

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:

enter image description here

UPDATE 2: ... and for comparison, here's how it looks with the solution (background-color: white) applied - http://jsfiddle.net/CJg43/23/

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...