Survey Form - Build a Survey Form

Tell us what’s happening:

My problem is that the footer text is lying at the very bottom of the screen (picture attached). I tried giving it a margin-bottom with different values but nothing happened. If I give it a padding-bottom of even 1px it looks weird as it adds a lot of space both above and below the text. I don’t understand why this is happening. Is there something I can try to fix it? Also, if you notice something else that shouldn’t be the way it, please let me know. I’d really appreciate it a lot! :slight_smile:
Screenshot 2024-01-06 203156

Your code so far

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Christmas Poll</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="styles.css" rel="stylesheet" />
  </head>

  <body>
    <h1 id="title">Christmas Poll</h1>
    <p id="description">87% people say that Christmas is the most awaited time of the year*</p>
    <form id="survey-form">
      
      <fieldset id="personal-info">
        <legend>Let Us Get To Know You</legend>
        <label id="name-label" for="name" class="bio">Name
          <input id="name" name="Name" type="text" placeholder="Enter your full name" required />
        </label>
        <label id="email-label" for="email" class="bio">Email
          <input id="email" name="Email-ID" type="email" placeholder="Enter your email" required />
        </label>
        <label id="number-label" for="number" class="bio">Age
          <input id="number" name="Age" type="number" placeholder="Enter your age (in years)" min="10" max="120" required />
        </label>
        <label id="sex-label" for="dropdown" class="bio">Sex
          <select id="dropdown" name="Sex" required>
            <option value="">(select one)</option>
            <option value="1">Male</option>
            <option value="2">Female</option>
            <option value="3">Others</option>
            <option value="4">Prefer not to say</option>
          </select>
        </label>
      </fieldset>
      
      <fieldset>
        <legend>Do you prefer real or fake Christmas trees?</legend>
        <label for="RT"><input id="RT" type="radio" name="tree" value="RT" checked class="inline"/> Real trees all the way!</label>
        <label for="FT"><input id="FT" type="radio" name="tree" value="FT" class="inline"/> I'll stick to fake trees - less mess</label>
        <label for="N"><input id="N" type="radio" name="tree" value="N" class="inline"/> Neither</label>
      </fieldset>

      <fieldset>
        <legend>What's your favorite Christmas song?</legend>
        <label for="JBR"><input id="JBR" type="checkbox" name="Song" value="JBR" checked class="inline"/> Jingle Bell Rocks</label>
        <label for="RACT"><input id="RACT" type="checkbox" name="Song" value="RACT" class="inline"/> Rockin' Around the Christmas Tree</label>
        <label for="SCCT"><input id="SCCT" type="checkbox" name="Song" value="SCCT" class="inline"/> Santa Claus is Coming to Town</label>
        <label for="AIWC"><input id="AIWC" type="checkbox" name="Song" value="AIWC" class="inline"/> All I Want for Christmas</label>
        <label for="SR"><input id="SR" type="checkbox" name="Song" value="SR" class="inline"/> Sleigh Ride</label>
        <label for="IMWTY"><input id="IMWTY" type="checkbox" name="Song" value="IMWTY" class="inline"/> It's the Most Wonderful Time of the Year</label>
        <label for="HJC"><input id="HJC" type="checkbox" name="Song" value="HJC" class="inline"/> Holly Jolly Christmas</label>
      </fieldset>
      
      <fieldset>
        <legend>Is the 1st week of November too early to start Christmas shopping?</legend>
        <label for="Y"><input id="Y" type="radio" name="gifts" value="Y" checked class="inline"/> WAY too early</label>
        <label for="N"><input id="N" type="radio" name="gifts" value="N" class="inline"/> I've been shopping for a while...</label>
        <label for="OK"><input id="OK" type="radio" name="gifts" value="OK" class="inline"/> It's the perfect time to start</label>
      </fieldset>

      <fieldset>
        <legend>Which Christmas cookie is your favorite?</legend>
        <label for="PBB"><input id="PBB" type="checkbox" name="Cookie" value="PBB" checked class="inline"/> Peanut Butter Blossoms</label>
        <label for="CC"><input id="CC" type="checkbox" name="Cookie" value="CC" class="inline"/> Chocolate Chip</label>
        <label for="RTC"><input id="RTC" type="checkbox" name="Cookie" value="RTC" class="inline"/> Russian Tea Cakes</label>
        <label for="GB"><input id="GB" type="checkbox" name="Cookie" value="GB" class="inline"/> Gingerbread</label>
        <label for="SD"><input id="SD" type="checkbox" name="Cookie" value="SD" class="inline"/> Snickerdoodle</label>
        <label for="SC"><input id="SC" type="checkbox" name="Cookie" value="SC" class="inline"/> Spritz Cookies</label>
        <label for="DSC"><input id="DSC" type="checkbox" name="Cookie" value="DSC" class="inline"/> Decorated Sugar Cookies</label>
      </fieldset>

      <fieldset>
        <label for="celebration"><strong>How do you and your family/friends celebrate Christmas?</strong>
        <textarea rows="3" cols="30" id="celebration" name="Celebration-way" placeholder="We gather together and ...."></textarea></label>
      </fieldset>

      <button id="submit" type="submit">Submit!</button>
    </form>
    <footer>
      <p>
      *<a target="_blank" href="https://tgmresearch.com/christmas2021-global-survey.html">Christmas Global Survey</a> by <a target="_blank" href="https://tgmresearch.com/">TGM Research</a>, December 2021, N=14250
      </p>
    </footer>
  </body>
</html>
/*Stylesheet*/

body {
  width: 100%; /*100 vw doesn't work well cause of scrollbar(?)*/
  height: 100vh;
  margin: 0;
  padding: 0;
  font-family: Georgia, serif;
  font-size: 16px;
  background-color: #9F0E17;
  color: #FAEDDA;
}

h1 {
  font-family: Papyrus, fantasy;
  text-align: center;
  font-size: 2.5rem;
  margin: 1rem 0 0.5rem;
  padding: 0;
}

#description {
  text-align: center;
  font-style: Italic;
  font-size: 1.1rem;
  margin: 0.5rem 0;
  padding: 0;
}

form {
  width: 70%;
  max-width: 700px;
  min-width: 300px;
  margin: 1.8rem auto 1.7rem;
  background-color: #F3BB8A;
  border-radius: 5px;
  padding: 0.8rem 1rem 1.3rem;
  color: #9F0E17;
}

fieldset {
  border: none;
  border-bottom: 3px solid #FAEDDA;
  margin-top: 1rem;
  padding-bottom: 1rem
}

fieldset:last-of-type {
  border-bottom: none;
  margin-top: 0.4rem;
}

fieldset:first-of-type {
  margin-top: 0;
}

legend {
  font-weight: bold;
}

label {
  display: block;
  padding: 0.2rem 0;
}

.bio {
  padding-left: 0.2rem
}

input, select, textarea {
  width: 100%;
  min-height: 1.6rem;
  background-color: #F1D1AB;
  border: 1.7px solid #FAEDDA;
  color: #9F0E17;
  font-family: Georgia, serif;
  margin-top: 0.5rem;
  border-radius: 3px;
}

/*This pseudo-element selector allows styling of placeholder attribute*/
::placeholder {
  color: #9F0E17;
  opacity: 0.8;
}

.inline {
  display: inline;
  width: unset;
  vertical-align: middle;
  margin: 0 0 0.1rem 0;
}

textarea {
  margin-top: 1rem;
}

button {
  display: block;
  width: 60%;
  font-size: 1.1rem;
  font-family: Georgia;
  min-height: 2rem;
  color: #F3BB8A;
  background-color: #9F0E17;
  border: 1px solid #9F0E17;
  border-radius: 3px;
  margin: 0.7rem auto;
  cursor: pointer;
}

button:hover {
  color: #9F0E17;
  background-color: #F3BB8A;
  border: 3px solid #9F0E17;
}

footer {
  font-variant: small-caps;
  font-size: 0.9rem;
  text-align: center;
}

a {
  color: #FAEDDA;
}

a:hover {
  color: #F1D1AB;
  cursor: pointer;
}

a:visited {
  color: #FAEDDA;
}

a:active {
  color: #F1D1AB;
}

/* Color Palette ('The Depths of Red') taken from Color Meanings. 
URL=https://www.color-meanings.com/christmas-color-palettes/ */

Your browser information:

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

Challenge Information:

Survey Form - Build a Survey Form

Hi. Your code looks fine on my end. You might want to resize the window? The footer text isn’t at the bottom on my screen.

1 Like

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