0

I'm trying to change the color of some jQuery UI sortable using CSS: Check this fiddle:

http://jsfiddle.net/fwcLd8mg/2/

When I set the .default background all the boxes turn to that color. But when I specify background in each list, the background of the list changes, not the boxes.

How do i specify colors for the boxes?

CSS:

#sortable-5 {
background: #ff0000;
}
#sortable-6 {
background: #00b8ff;
}
#sortable-7{
background: #000000;
}
#sortable-5, #sortable-6,#sortable-7 { 
list-style-type: none; margin: 0; padding: 0;
width: 20%;float:left
}
#sortable-5 li, #sortable-6 li,#sortable-7 li { 
margin: 0 3px 3px 3px; padding: 0.4em; 
padding-left: 1.5em; font-size: 17px; height: 50px;
}
.default {
background: #b2f5fb;
border: 1px solid #DDDDDD;
color: #333333;
} 
3
  • Do you mean like this? Commented Oct 31, 2014 at 11:33
  • @chriz Yes Thank You! I got three working examples! Commented Oct 31, 2014 at 11:39
  • Nice! Make sure you accept one of the other answers if that has worked for you. Commented Oct 31, 2014 at 11:41

2 Answers 2

1

You need to apply the colours to the LI elements. Since you've added a default class to them, you can use that:

#sortable-5>.default {
    background: #ff0000;
}
#sortable-6>.default {
    background: #00b8ff;
}
#sortable-7>.default{
    background: #000000;
}

Updated fiddle

Sign up to request clarification or add additional context in comments.

Comments

0

To change the background color of the boxes (.default) in each list you need to make it like this

#sortable-5 .default{
    background: #ff0000;
}

Example here http://jsfiddle.net/fwcLd8mg/6/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.