问题
I'm implementing jQuery Mobile for the first time and am having a hard time changing the background color of my site's body. Instead of posting all of the HTML and CSS here (because it's long), you can look at the source here: http://www.tommaxwell.me
I've tried adding it to the desktop media query, the body of the site outside of any media queries, and no luck. This is weird, but I've never used jQuery Mobile before.
回答1:
Change this css properties in your siteredesign.css(make sure it overrides jquery.mobile.css):
.ui-body-c, .ui-overlay-c { background:#000; }
回答2:
As an alternative for changing the data theme itself (.ui-body-c ..), you could also use another of the predefined data themes, i.e theme "a":
<div data-role="page" data-theme="a">
回答3:
this worked on the main div: data-role="page" data-theme="b"
回答4:
For jqm defined 5 themes.
A and B and C and D and E .
You should set data-theme for each element in page. Without data-theme for elements, their theme is "A" theme.
default theme:
<div class="ui-content" role="main">
Your favorite theme :
<div class="ui-content" role="main" data-theme="e">
for custom themes color out of this five theme, you should change jquery.mobile.css file and you should know css coding.
来源:https://stackoverflow.com/questions/14331596/cant-change-jquery-mobile-background-color