Changing colour of selected choice | XM Community
Skip to main content
Question

Changing colour of selected choice


Forum|alt.badge.img+2

hi everyone, i’ve set up the css based on forum advice for my 1-10 rating question. however, respondents are unable to see their selected choice now. what would be the correct “selected” choice code to be applied? does it have to be written for each of the label?

 

.LabelContainer:hover 
{
z-index:1 ;
transition:all 0.3s ;
transform:scale(1.2,1.2) ;
}

#QID2-1-label
{
background-color: #d35242  ;
color: white;
}

#QID2-2-label
{
background-color: #ce6448  ;
color: white;
}

#QID2-3-label
{
background-color: #c9744e  ;
color: white;
}

#QID2-4-label
{
background-color: #c38154  ;
color: white;
}

#QID2-5-label
{
background-color: #be8d59  ;
color: white;
}

#QID2-6-label
{
background-color: #b8995d  ;
color: white;
}

#QID2-7-label
{
background-color: #b8995d  ;
color: white;
}

#QID2-8-label
{
background-color: #b2a362  ;
color: white;
}

#QID2-9-label
{
background-color: #80b75c  ;
color: white;
}

#QID2-10-label
{
background-color: #5ec159  ;
color: white;

6 replies

Forum|alt.badge.img+2
  • Author
  • 6 replies
  • October 19, 2023

I managed to find the custom code such that the selected score is shaded in black. however, when i move on to the selection of response choice for the next question, the black shading disappears again

 

.Skin label.SingleAnswer:hover 
{background-color: #107da3 !important;
}
.LabelContainer:hover 
{
z-index:1 ;
transition:all 0.3s ;
transform:scale(1.2,1.2) ;
}

#QID2-1-label
{
background-color: #bd6158  ;
color: black;
}

#QID2-2-label
{
background-color: #c46758  ;
color: black;
}

#QID2-3-label
{
background-color: #cb6e58  ;
color: black;
}

#QID2-4-label
{
background-color: #d77b58  ;
color: black;
}

#QID2-5-label
{
background-color: #dd8358  ;
color: black;
}

#QID2-6-label
{
background-color: #e79257  ;
color: black;
}

#QID2-7-label
{
background-color: #fafa6e  ;
color: black;
}

#QID2-8-label
{
background-color:#eaf66f  ;
color: black;
}

#QID2-9-label
{
background-color: #9ee07b  ;
color: black;
}

#QID2-10-label
{
background-color: #83d681  ;
color: black;
}

.Skin label.SingleAnswer.q-checked.q-focused {
    color: #ffffff !important;
    border-style: solid !important;
    border-width: 2px !important;
    border-color: #000000 !important;
    background-color: #000000 !important;
}


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • October 19, 2023

Remove .q-focused from your last rule.


Forum|alt.badge.img+2
  • Author
  • 6 replies
  • October 19, 2023
TomG wrote:

Remove .q-focused from your last rule.

I encounter the selected choice highlights disappearing somehow because of the codes above when ive created different displays of colour, but the other questions are functioning as per expected behaviour.

  1. on click it shows this

 

  1. when i select the response choice for the next question, the border goes off again

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • October 19, 2023

@Jason Ling - I would have to see a survey preview to diagnose further.


Forum|alt.badge.img+2
  • Author
  • 6 replies
  • October 20, 2023
TomG wrote:

@Jason Ling - I would have to see a survey preview to diagnose further.

Thank you Tom. Thanks for suggesting the survey preview link as the screenshots were definitely not easy to show what was happening.

https://shorturl.at/hntH2


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • October 20, 2023

@Jason Ling

Add this rule:

.Skin label.MultipleAnswer.q-checked, .Skin label.SingleAnswer.q-checked {
    box-shadow: 0 0 0 3px activeborder;
    outline: #a9bccc auto 5px;
}

 


Leave a Reply