您好,我想为按钮内的文本添加颜色,还想从按钮中删除边框和轮廓,但我无法修复它。请任何人帮助我。我正在使用 jquery-mobile。
<div class="ui-btn-right" data-role="controlgroup" data-type="horizontal" data-corner="false">
<input type="submit" value="post" id="post" onClick="postprivate()" style="color:green;" ></input>
</div>
这是我正在尝试但根本没有应用的 css
#post{color:green;
text-decoration:none:
font-size:24px;
margin-right:20px;
outline:none;
width:60px;
border:0px;
display:block;}
最佳答案
jQuery Mobile 提供了一个名为 data-wrapper-class 的属性 将命名的 CSS 类应用到它在增强输入时创建的 ui-btn DIV。所以你可以这样做:
<input type="submit" value="post" id="post" onClick="postprivate()" data-wrapper-class="mybuttonstyle"></input>
.mybuttonstyle {
color: green !important;
font-size:24px !important;
margin-right:20px;
outline:none;
width:60px;
border:0px;
}
Here is a DEMO
关于javascript - 如何在 jQuery Mobile 中为按钮添加文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27374479/