Reputation: 25
hi i want to add color to the text inside button and also want to remove border and outline from the button but i couldnt fix it.please anybody help me out.i am using 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>
and this is the css which i am trying but its not applied at all
#post{color:green;
text-decoration:none:
font-size:24px;
margin-right:20px;
outline:none;
width:60px;
border:0px;
display:block;}
Upvotes: 1
Views: 1172
Reputation: 24738
jQuery Mobile provides an attribute called data-wrapper-class that applys a named CSS class to the ui-btn DIV it creates when enhancing the input. So you can do something like this:
<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
Upvotes: 2
Reputation: 3668
if you inspect element, you will find out input
does not display, a span class="ui-btn-inner"
instead it.
so using js code to change the span color property
$(function()
{
$('#post').prev('span.ui-btn-inner').css('color','green');
});
the result
jsfiddle http://jsfiddle.net/6rbf2Lmu/
Upvotes: 1