-7

Hi I have the code where i have two button in the div using jquery mobile but while put some style on the button its not taking the Style.Then how to achieve that using jquery mobile?

.ui-block-b .ui-btn .ui-input-btn .ui-corner-all .ui-shadow {
    background:yellow;
}
<div data-role="ui-grid-a">
  
  
<div>
S Das
  • 51
  • 5

4 Answers4

1

If you have element with multiple classes (regarding comments at question), like

<div class="ui-btn ui-input-btn ui-corner-all ui-shadow">

and you need to set styles, you have two options:

First is to set background to one of these classes, eg.

.ui-corner-all {background: yellow;}

The second one, if you want to target just element with all classes, the correct selector is

.ui-btn.ui-input-btn.ui-corner-all.ui-shadow {background: yellow}

Your attempt .ui-block-b .ui-btn .ui-input-btn .ui-corner-all .ui-shadow tried to find .ui-shadow in .ui-corner-all in .ui-input-btn in .ui-btn in .ui-block-b like:

<div class="ui-block-b">
    <div class="ui-btn">
        <div class="ui-input-btn">
            <div class="ui-corner-all">
                <button class="ui-shadow">
            </div>
        </div>
    </div>
</div>

This HTML markup doesn't exist.

pavel
  • 26,538
  • 10
  • 45
  • 61
  • @SnehasishDas: But in your fiddle there is no `.ui-input-btn` class. The color is light because of `opacity: .1`. – pavel Jun 04 '15 at 08:48
  • @SnehasishDas: try to do something yourself. It's so easy how to override one value by second one. – pavel Jun 04 '15 at 09:09
0

You have wrongly written the css code. Try this.

.ui-block-b input[type="submit"]{
           background:yellow;
        }
    <div data-role="ui-grid-a">

      <div class="ui-block-a" style="width:50%">
        <input type="button" id="Previous" value="Previous" onclick="window.location.href='%bind(:24)'" />
      </div>
      <div class="ui-block-b" style="width:50%">
     <input type="Submit" id="Submit" value="Save and Next" />
      </div>
    <div>
Satrughna
  • 93
  • 2
  • 14
0

Use , between if you want to give css to multiple class.

And use > if you want to give css to input inside div.

.ui-block-b, .ui-btn, .ui-input-btn, .ui-corner-all, .ui-shadow{
       background:yellow;
    }

.ui-block-a > input{
  background:yellow;
  }
<div data-role="ui-grid-a">

  <div class="ui-block-a" style="width:50%">
    <input type="button" id="Previous" value="Previous" onclick="window.location.href='%bind(:24)'" />
  </div>
  <div class="ui-block-b" style="width:50%">
 <input type="Submit" id="Submit" value="Save and Next" />
  </div>
<div>
ketan
  • 19,129
  • 42
  • 60
  • 98
-1

.ui-btn .ui-input-btn .ui-corner-all .ui-shadow these classes are non-existant.

odedta
  • 2,430
  • 4
  • 24
  • 51
  • It's enough to only address one class, no need to write all of them. It would be better if you post a link or a working example. – odedta Jun 04 '15 at 08:14
  • 1
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. – Nico Jun 04 '15 at 09:53
  • @Nico, you might want to read the question and my answer again. – odedta Jun 04 '15 at 10:53