Survey Form - Build a Survey Form

Tell us what’s happening:
Describe your issue in detail here.

hello, I just want to know how to make the background-color above the background-photo in css body? the background-image covers the background-color and I want it to make it in the contrary.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <title>Survey Form</title>
    <link rel="stylesheet" href="styles.css">

  <h1 id="title">freeCodeCamp Survey Form</h1>
  <p id="description">Thank you for taking the time to help us improve the platform</p>
  <form id="survey-form" method="post" action=''>
          <label for="name" id="name-label">Name<input id="name" type="text" placeholder="Enter your name" required></label>
          <label for="email" id="email-label">Email<input id="email" type="email" placeholder="Enter your email" required></label>
          <label for="number" id="number-label">Age(optional)<input id="number" type="number" placeholder="Enter your age" min="10" max="120"></label>
          <label for="dropdown">Which option best describes your current role?
            <select id="dropdown">
              <option value="">select one</option>
              <option value="1">student</option>
              <option value="2">part time job</option>      
          <label class="group">Would you recommend freeCodeCamp to a friend?
            <label for="definitely" ><input id="definitely" type="radio" value="definitely" name="recommendation" class="inline">Definitely</label>
            <label for="maybe" ><input id="maybe" type="radio" name="recommendation" value="maybe" class="inline">Maybe</label>
            <label for="not sure" ><input id="not sure" type="radio" name="recommendation" value="not sure" class="inline">Not sure</label>
          <label for="features">What is your favorite feature of freeCodeCamp?
            <select id="features" name="features">
              <option value="">select one</option>
              <option value="1">challenges</option>
              <option value="2">projects</option>
          <label class="group">What would you like to see improved? (<div>Check all that apply</div>)
            <label for="font projects" ><input id="font projects" value="font-end projects" type="checkbox" name="improve" class="inline">Font-end projects</label>
            <label for="back projects" ><input id="back projects" value="back-end projects" type="checkbox" name="improve" class="inline">back-end projects</label>
            <label for="challenges" ><input id="challenges" value="challenges" type="checkbox" name="improve" class="inline">Challenges</label>
        <label for="comment">
          <textarea id"comment" name="comment" placeholder="Any comments or suggestions?" cols="16" rows="3"></textarea>
/* file: styles.css */
  background-color: rgba(115, 114, 187, 0.5);
  background-image: url(;
  width: 100%;
  margin: 0;
  font-family: Sans-Serif;

  font-style: italic;

  display: inline-block;
  font-size: 13px;

h1, p{
  margin: 1em auto;
  text-align: center;

  padding: 0px 20;
  background-color: rgba(35, 35, 68, 0.9);
  border: none;

  width: 70%;
  margin: 0 auto;
  min-width: 300px;
  max-width: 500px;

  width: 100%;
  margin: 5px 0 0 0;

.group label{
  margin: 5px 0;

  display: block;
  margin: 1em 0;

  width: unset;
  margin: 0 5px 0 0;
  vertical-align: middle;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36 Edg/109.0.1518.95

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

Welcome to our community!

Ad the folowing property in your ‘body’ selector:

box-shadow: inset 0 0 0 1000px rgba(0,0,0,.2); 
  • change the value of the last number in ‘rgba’ to create different shade over the background image
1 Like

This page has some different examples. It is using a modal but the same ideas would apply to a color overlay on a background image.

The example form is using a pseudo-element for the overlay BTW.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.