Tom Maxwell
Tom Maxwell

Reputation: 9573

Can't change jQuery Mobile background color?

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.

Upvotes: 5

Views: 16913

Answers (4)

negin51
negin51

Reputation: 1

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.

Upvotes: -3

Flavio Ceratti
Flavio Ceratti

Reputation: 26

this worked on the main div: data-role="page" data-theme="b"

Upvotes: 0

EggMayo
EggMayo

Reputation: 11

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">

Upvotes: 1

Rajiv007
Rajiv007

Reputation: 1136

Change this css properties in your siteredesign.css(make sure it overrides jquery.mobile.css):

.ui-body-c, .ui-overlay-c { background:#000; }

Upvotes: 15

Related Questions