【问题标题】:jQuery Mobile framework - custom image for submit buttonjQuery Mobile 框架 - 提交按钮的自定义图像
【发布时间】:2013-05-06 21:54:20
【问题描述】:

我想为提交按钮使用图像,但以下代码不起作用:

<input type="submit" id="btnSubmit" data-role="none" class="loginSubmit" />

css:

.loginSubmit {background: url("images/submit.png") no-repeat   scroll transparent; display:block;height:54px;}

同样的代码适用于 a 标签。

 <a data-theme="" id="btnSubmit" class="loginSubmit" />

尝试了Custom Input[type="submit"] style not working with jquerymobile button 中建议的解决方案,但它也不起作用。我正在使用最新版本的 jQuery mobile。

【问题讨论】:

  • 你是否在 CSS 中的每个属性后添加了!important?添加data-role=button
  • 勾选此fiddle.jshell.net/Palestinian/fkzhz无需添加data-role=button
  • 您可以使用带文字的图像吗?奇怪的是,背景颜色似乎更新了,但文字没有更新。
  • 图像为渐变蓝色。文字我们是红色的,虽然我删除了!important
  • 需要放一个高度和一个宽度。现在工作。

标签: jquery-mobile


【解决方案1】:

为避免 JQuery 移动覆盖样式,将 data-enhance="false" 添加到元素:

<input type="submit" id="btnSubmit" class="loginSubmit" data-enhance="false" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-24
    • 1970-01-01
    相关资源
    最近更新 更多