我在表单按钮上有以下代码,但无法更改其内部文本的颜色:
<input type="button" name="continue" value="" class="next">
input.next {
color: white;
background: #199dd9;
text-align: left;
text-transform: uppercase;
}
其他样式(即文本对齐、背景颜色)有效,但字体颜色仍然是黑色。我在 devtools 中检查,似乎没有任何内容覆盖它。
最佳答案
而不是 <input>
标签,使用 HTML5 的 <button>
标签。
button.next {
color: white;
background: #199dd9;
text-align: left;
text-transform: uppercase;
}
<button name="continue" class="next">Click me!</button>
关于html - 如何更改输入按钮字体颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27369136/