1

I'm trying to override the standard styling of a listview li element in jquery mobile. I tried just setting a rule at the end of all the css

li{
background-color:#ffffff;
border:none;
border-bottom: 1px solid #eeeeee;
}

But there are still some styles being applied. I just want a solid background color and no gradient stuff.

Brian
  • 4,328
  • 13
  • 58
  • 103
  • If there are any rules regarding these elements with a class/id, such as `li.listview` or `#listview li`, they will override `li`. See [this](http://css-tricks.com/specifics-on-css-specificity/). – Martti Laine Feb 15 '12 at 05:35

3 Answers3

3

Try this:

li{
background:#ffffff !important;
border:none;
border-bottom: 1px solid #eeeeee;
}

This will override the gradient colors created by jQuery Mobile using background-image style

user700284
  • 13,540
  • 8
  • 40
  • 74
  • WARNING: This will set the color for all themes, in all states (selected and hover as well). – Daniel Nov 11 '13 at 11:08
1

try adding this to your code...

background-image:url('ANYNONEXISTINGIMAGE');

so, your code would look like this...

li{
    background-color:#ffffff;
    border:none;
    border-bottom: 1px solid #eeeeee;
    background-image:url('ANYNONEXISTINGIMAGE');
}
Naveed Butt
  • 2,861
  • 6
  • 32
  • 55
0

If you only want to remove all gradients from the list elements and don't want to overwrite colors, add this line to your li style:

background-image: none !important;
Daniel
  • 20,420
  • 10
  • 92
  • 149