How do I customize the background color on the Driving Distance widget?

  • writeitright
    Asked on April 19, 2016 at 12:01 AM

    Because my forms use a black background and the font color used by the driving distance widget is also black, the text is not visible on my website.

    Could you please help me with a work around?

    Jotform Thread 821628 Screenshot
  • Nik_C
    Replied on April 19, 2016 at 4:40 AM

    You can do that by going to your Driving Distance widget wizard:

    How do I customize the background color on the Driving Distance widget? Image 1 Screenshot 30

    And then to Custom CSS:

    How do I customize the background color on the Driving Distance widget? Image 2 Screenshot 41

    You can paste this code there:

    #ddForm {

    background-color: red;

    }

    To change the background of the widget.

    I put red, but feel free to change to any color that suits you.

    Please let me know if you have further questions.

    Thank you!

  • writeitright
    Replied on April 19, 2016 at 4:16 PM

    Thank you! Your solution works to change the background of the entry field, but it does not change the background of the field that populates to display the calculation. 

    Here's what it looks like when the user provides the departure city/destination for calculation:

    How do I customize the background color on the Driving Distance widget? Image 1 Screenshot 30

    Here's what it looks like when the user clicks the Calculate button:

    How do I customize the background color on the Driving Distance widget? Image 2 Screenshot 41

  • Boris
    Replied on April 19, 2016 at 5:35 PM

    In order to change the background of the results as well, you should use #ddResult selector in your CSS. Your custom CSS would end up looking like this:

    #ddForm, #ddResult {
    background-color: grey;
    }

    How do I customize the background color on the Driving Distance widget? Image 1 Screenshot 20

    This will force the results/calculation to look the same as the initial page of the Driving Distance widget. If you want to have different color background for each of these two pages, then you can use custom CSS such as this:

    #ddForm {
    background-color: grey;
    }
    #ddResult {
    background-color: lightgray;
    }

    Please let us know if you need any further assistance.