Forums

Set background colors for fieldsets

momentis 07 Jan, 2016
I have a form with 5 fieldsets. Is there a way to set the background color for each fieldset to something different? I want my users to be able to easily see the different sections.

Rick
momentis 07 Jan, 2016
Or at least one background (grey) alternated by fieldset (not by fields)?

Rick
momentis 07 Jan, 2016
Each fieldset has, of course, a unique ID. I have tried adding this to a Load CSS action:
.fieldset_id {
background-color:XXXXX;
}


Which does not work. I can wrap a DIV around what's inside the fieldset, but then it of course just adds color behind the fields.
GreyHead 07 Jan, 2016
Answer
Hi Rick,

A CSS selector for an ID needs to begin with a # - a . is for a class selector:
#fieldset_id {
  background-color:XXXXX;
}
For a ChronoForms Fieldset you may also need to color the legend background and add a little padding
#traveller_1,  #traveller_1 legend{
  background-color: aliceblue;
  padding: 6px;
}

Bob
momentis 07 Jan, 2016
Oh my gosh. If only I understood CSS better!!!!

Thanks Bob!

Rick
This topic is locked and no more replies can be posted.