Voltaire
Posts: 0
Joined: Thu Apr 09, 2015 8:48 pm

Listitem odd even css

Hello, am trying to change the background of a listitem , in a css file if I put

li { background: #003a6a !important; }
li:nth-child(even) { background: #004278 !important; }

It is working fine but it is affecting all tables in other pages,I tried to use it for a specific listitem with the following code

[name=mobilelist_2].ui-listview .ui-li { background: #003a6a !important; }
[name=mobilelist_2].ui-listview .ui-li:nth-child(even) { background: #004278 !important; }

where the listitem name is mobilelist_2 , but it is not working.

Can you provide me with the right syntax to change the li css of a specific element.

Thanks in advance

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Listitem odd even css

Hello,

Please use CSS below for that:
pre#startScreen .ui-btn[name=mobilelistitem_9]{
background-color:red;
}/pre

here startScreen - name of the page
mobilelistitem_9 - name of the listitem

Voltaire
Posts: 0
Joined: Thu Apr 09, 2015 8:48 pm

Listitem odd even css

Thanks Sergiy for you support, this what I was looking for,
still I found a method to solve my problem through this method:
.oddaeven
li {
background: #003a6a !important;
}

.oddaeven1
li:nth-child(even) {
background: #004278 !important;
}

it took me 2 hours by trial and error :)

Thanks again.

Return to “Issues”