Matt
Matt

Reputation: 1923

Change background-color with jQuery Mobile

I want to change the global background-color for my app, but things don't work.

Adding CSS to the body doesn't work (neither does adding CSS to html element)

body {
    background-color:#2b2e31;
}

Adding id's to my div-elements works sometimes, but I'm not gonna add an Id to all my elements.

Does anybody know how to solve this?

Upvotes: 13

Views: 19028

Answers (3)

Ben Shoval
Ben Shoval

Reputation: 1750

You need to modify the ui-page class. It may also be helpful to use !important so the rule will always be applied no matter where it appears in the CSS.

.ui-page {
  background-color: #2b2e31 !important;
}

Upvotes: 0

Matt
Matt

Reputation: 1923

This solved it

.ui-page { 
    background:#2b2e31;
}

Upvotes: 14

Rijin Mk
Rijin Mk

Reputation: 414

Or maybe this might work. Just download the 'Without-A-Theme' jQuery mobile CSS version. Here is the link: http://code.jquery.com/mobile/1.3.2/jquery.mobile.structure-1.3.2.min.css You can find this in the jQuery mobile page

Upvotes: 2

Related Questions