javascript - 如何在 jQuery Mobile 中为按钮添加文本颜色

标签 javascript jquery css jquery-mobile button

您好,我想为按钮内的文本添加颜色,还想从按钮中删除边框和轮廓,但我无法修复它。请任何人帮助我。我正在使用 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/

相关文章:

javascript - jQuery/Javascript 从对象数组中删除对象

javascript - 将函数作为参数传递

javascript - HTML 输入值追加到 Bootstrap 表

javascript - React 组件 css 设置不正确

javascript - 在 Vue3 组合 API 中让观察者立即工作

javascript - ActiveX - 自动化服务器无法创建对象

jquery - 如何在 yii 中显示图像而不是文件字段

javascript - 我不明白 jQuery .each() 和 .html() 方法是如何工作的

jQuery:仅从右侧滑入

html - react 组件高度