0

我创建了我的按钮

   <a href = "#" data-role = "button" data-theme = "a" id = "button_style" onClick = "check()">

我试图将样式应用于它

.button_style{
     ---
 }

CSS 和 jQueryMobile 效果都不适用于按钮。如果我同时包含 CSS 样式和 jQueryMobile 样式,则 jQueryMobile 效果(如数据主题等)不适用于按钮。但我需要 CSS 样式和 jQueryMobile 样式到 HTML 标记元素。我怎样才能为按钮实现这两个目标?

4

4 回答 4

0

好吧,没有看到你到底想要什么是我的尝试:

我从其他答案和评论中拼凑而成:

CSS:

.button_style {
    width : 40px !important;
    height : 40px !important;
    background: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(63,67,75)), color-stop(1, rgb(40,42,47)) );
    background: -moz-linear-gradient( center bottom, rgb(63,67,75) 0%, rgb(40,42,47) 100% ) !important;
    padding: -3px;
    -webkit-border-radius: 9px !important;
}

HTML:

<div>
    <a href="#" data-role="button" data-theme="a" class="button_style" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="b" class="button_style" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="c" class="button_style" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="d" class="button_style" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="e" class="button_style" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="a" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="b" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="c" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="d" onClick="check()">Test Button</a>
    <a href="#" data-role="button" data-theme="e" onClick="check()">Test Button</a>
</div>

我的想法是你能用 Theme Roller 做到这一点吗?

您还可以尝试一些按钮选项:

于 2012-06-12T05:45:36.597 回答
0

你使用 .button_style.. 这表明 button_style 是一个类。但是你有一个 id 是 button_style 的按钮。所以你应该使用

#button_style{
 ---

}

检查此链接//已编辑

http://jsfiddle.net/fLq3C/45/

于 2012-06-12T04:30:31.680 回答
0

因为没有使用 Id (#)。您使用了类符号 (.)。因此它不适用

利用

#button_style
{
 ---
 }
于 2012-06-12T04:32:45.123 回答
0

我刚刚用你的代码创建了一个Jsfiddle 。通过更改#button_style样式可以正常工作。

核实。干杯!!!

于 2012-06-12T05:01:52.383 回答