I'm trying to resize the <li>
s in my jQuery mobile site (listview) and can't seem to find the right class in CSS to do it. I've basically resized some of the elements (the header and footer, etc.). I have five <li>
buttons stacked vertically and there is a gap below the buttons and the footer.
I just want to set each <li>
's height to 20% (that would do the trick since there is five of them and they are nested in a body content div. Does anyone know the class in the jQuery Mobile CSS that controls this? I can't seem to find this info in a search. Here's a link to the CSS for reference:
Thanks!
UPDATE
I was originally meaning to discuss 'listview' exclusively for the buttons. I was too broad in my original explanation but basically I'm trying to resize not all buttons but just the <li>
s.
Why so complicated? This would do the trick too IMHO.
.ui-btn
is the class you have to use.But this same class is used not just by "buttons" alone .Other jQuery Mobile components likelistview
also make use of it.So if you set the height of.ui-btn
you will mess up those components too.So it is better to define a separate class,only for those five buttons and then set theheight
to20%
to that class.It is simple as that:
If you check-out the classes you can make your own decision about how to select the
LI
elements, I would use the.ui-li
class and if you want to make sure to only get onelistview
element then you can specify a more detailed selector:Here is some sample
listview
output from the jQuery Mobile docs:UPDATE
There was a little more to this than I had previously posted, here is some tested/working code:
Where
#my-page
is the id of mydata-role="page"
element and#my-listview
is the id of thedata-role="listview"
element.Here is a demo: http://jsfiddle.net/gu7WE/