2017-10-20 8 views
0

J'ai quelques problèmes changeant le background-color d'un listitem particulier dans mon jQuery-MobileListview. Tous les listitem ont leur propre ID. Je veux en changer un seul.changer la couleur listview dans jQuery-Mobile 1.4.5

S'il vous plaît aidez-moi :)

+3

Bienvenue sur Stack Overflow - agréable de vous. S'il vous plaît lire Comment puis-je poser une bonne question? https://stackoverflow.com/help/how-to-ask et Comment créer un exemple minimal, complet et vérifiable pour aider à maintenir le contenu de Stack Overflows au niveau le plus élevé possible et augmenter vos chances d'obtenir une réponse appropriée. https://stackoverflow.com/help/mcve –

Répondre

0

Ceci est un moyen possible de le faire:

#item-2 .ui-btn { 
 
    background-color: aliceblue !important; 
 
}
<!DOCTYPE html> 
 
<html> 
 

 
<head> 
 
    <meta charset="utf-8"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> 
 
    <link href="https://fonts.googleapis.com/css?family=Jura" rel="stylesheet"> 
 
    <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.css"> 
 
    <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script> 
 
    <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> 
 
</head> 
 

 
<body> 
 
    <div data-role="page" id="page-one"> 
 
    <div data-role="content"> 
 
     <ul data-role="listview" data-inset="true"> 
 
     <li data-role="list-divider">Friday, October 8, 2010 <span class="ui-li-count">2</span></li> 
 
     <li id="item-1"> 
 
      <a href="index.html"> 
 
      <h2>Stephen Weber</h2> 
 
      <p><strong>You've been invited to a meeting at Filament Group in Boston, MA</strong></p> 
 
      <p>Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.</p> 
 
      <p class="ui-li-aside"><strong>6:24</strong>PM</p> 
 
      </a> 
 
     </li> 
 
     <li id="item-2"> 
 
      <a href="index.html"> 
 
      <h2>jQuery Team</h2> 
 
      <p><strong>Boston Conference Planning</strong></p> 
 
      <p>In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.</p> 
 
      <p class="ui-li-aside"><strong>9:18</strong>AM</p> 
 
      </a> 
 
     </li> 
 
     <li data-role="list-divider">Thursday, October 7, 2010 <span class="ui-li-count">1</span></li> 
 
     <li id="item-3"> 
 
      <a href="index.html"> 
 
      <h2>Avery Walker</h2> 
 
      <p><strong>Re: Dinner Tonight</strong></p> 
 
      <p>Sure, let's plan on meeting at Highland Kitchen at 8:00 tonight. Can't wait!</p> 
 
      <p class="ui-li-aside"><strong>4:48</strong>PM</p> 
 
      </a> 
 
     </li> 
 
     </ul> 
 
    </div> 
 
    </div> 
 
</body> 
 
</html>