Certification project 1 - Build a Form

Hello,

It was very exciting to start the first project on my own, before getting on the CSS at least :sweat_smile:.
That wasn’t a requirement, but I decided to go the extra mile and craft a nice form like the exemple. There was a bit of a learning curve and it took way more time than I’d like to admit, but I’m happy I made it and I learnt some cool stuff.

I’d love any feedback. Thanks!

(URL for background-image in body had to be removed for the post. It was a random surfing picture from Google)

HTML

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

<!-- Header -->

  <header>
    <h1 id="title">Surf Lesson Registration Form</h1>
    <p id="description">Welcome to our surfschool, <i>the best surfer out there is the one having the most fun!</i>
    </p>
  </header>

<!-- Form -->

  <form id="survey-form">

    <!-- Personnal informations -->

      <label for="name" id="name-label">Name*   <input id="name" type="text" name="full-name" placeholder="Enter your full name" required class="info-input-style"/></label>
      <label for="email" id="email-label">Email address*   <input id="email" type="email" name="email-address" placeholder="Enter your email address" required class="info-input-style"/></label>
      <label for="age" id="number-label">Age (optional)  <input id="number" type="number" name="age" placeholder="How old are you?" min="17" max="70" class="info-input-style"/></label>

    <!-- Radio for surf level selection -->

    <fieldset>
      What is your surfing experience?
        <div>
            <label><input type="radio" name="surfer-level" class="inline" value="1"> Begginer</label>
            <label><input type="radio" name="surfer-level" class="inline" value="2"> Intermediate</label>
            <label><input type="radio" name="surfer-level" class="inline" value="3"> Advanced
          </label>
        </div>
    </fieldset>

    <!-- Dropdown to select a surf spot -->

    <fieldset>
      <label for="dropdown" id="dropdown-label"> Select your favorite beach to practice
        <select id="dropdown" class="info-input-style">
          <option>Muizenberg</option>
          <option>Hossegor</option>
          <option>Hawaii</option>
          <option>Ericeira</option>
        </select>
      </label>
    </fieldset>

    <!-- Checkboxes for anything extra -->

    <fieldset>
      Is there anything else you require from the school?
      <div>
        <label><input type="checkbox" value="1" class="inline"> Rent a surf suit</label> 
        <label><input type="checkbox" value="2" class="inline"/> Rent a surf board</label> 
        <label><input type="checkbox" value="3" class="inline"/> Transportation to the beach</label>
        <label><input type="checkbox" value="4" class="inline"/> Lunch meal</label>
        </div>
    </fieldset>

    <!-- Text area for comments -->

    <fieldset>
      <label for="comments"> Let us know anything else :
        <textarea id="comments">
        </textarea>
      </label>
    </fieldset>

    <!-- submit button to register -->

    <button id="submit" form="survey-form" Type="submit" value="Submit">Register for a lesson</button>

  </form>
</body>
</html>

CSS

body {
  background: url(https://images.pexels.com/photos/111085/pexels-photo-111085.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1) rgba(175, 83, 83, 0.8);
  background-blend-mode: multiply;
  font-family: Arial;
  color: rgb(86, 39, 39);
  background-size: cover;
}

/* Form header style */

header {
  text-align: center;
  color: white;
  padding: 1em 1em;
}

h1 {
  font-family: Roboto;
}

/* form component styles */

form {
  background-color: rgb(239, 207, 49,0.8);
  font-size: 20px;
  max-width: 800px;
  min-width: 300px;
  margin: auto;
  width: 80%;
  border-radius: 10px;
  padding: 1em;
}

label, textarea, input, select, button {
  display: block;
}

fieldset {
  border-style: none;
}

.info-input-style {
  width: 95%;
  height: 35px;
  margin: 1em auto;
  background-color: rgba(255, 255, 255, 0.8);
  border-style: none;
  border-radius: 5px;
  padding-left: 20px;
  font-size: 16px;
}

div {
  padding: 20px 20px 0;
}

select {
  font-family: Arial;
  color: rgb(86, 39, 39);
}

textarea {
  background-color: rgb(255, 255, 255,0.8);
  border-radius: 5px;
  margin: 20px auto auto;
  height: 60px;
  width: 95%
}

.inline {
  display: inline;
}

/* Submition button style */

button {
  background-color: rgb(255, 149, 0);
  border-style: none;
  border-radius: 5px;
  height: 40px;
  width: 90%;
  margin: 20px auto;
  font-family: Roboto;
  font-size: 18px;
  color: white;
}

button:hover {
  box-shadow: 0px 0px 20px 5px red;
}```

Hello there!

I get the feeling! Translating your ideas into code can be a bit challenging but a fascinating journey! Well done.

Your code looks clean. I am certain you are going to improve on a few things like accessibility best practices, the use of more semantics and so on as you continue making more projects.

Btw, have you tried deploying your website so that you can let other people see the final product?

1 Like

Hey, this looks good. No errors in the code, which is great. Also, it’s neat and tidy. I don’t really have anything big to suggest. Just a few optional details:

        <textarea id="comments">
        </textarea>

I would put these tags on the same line. That helps avoid that creepy extra spacing at the beginning of your textarea element when the user wants to start typing.

        <textarea id="comments"></textarea>

Also, consider adding placeholder text:

<textarea id="comments" placeholder="Write something here..."></textarea>

Your hover effect on the submit button is cool, but that sudden intense shadow of orange just jars on my aesthetic taste a bit. Here’s what I would do to improve it:

  • Make the shadow smaller and more see-through.
  • Instead of just adding a shadow, scale the element a bit too. This is done with the CSS transform property. It’s very easy - all of it can be done on one line. This will make it feel like the button is larger too. But don’t overdo it.
  • Make the transition gradual with the CSS transition property. 0.5s should be enough, but feel free to adjust, of course.

Remember, with design, subtly is beauty. There’s no need to overdo anything. The user notices every detail, especially movement and shadow, and clean, smooth, minimum movement combined with good timing and well-blended palettes give your webpage a quality feel.

As @stephenmutheu suggested, it’s best to deploy your site so that others can see it live, and not just the code. There are a few ways to do this. If you have GitHub, you can host it there by putting the code in a repo and then making the site live. That’s a bit demanding for beginners though, and is really unnecessary for lightweight pages like these. What I use is a live code editor like CodePen or JSFiddle. I have put your code into a JSFiddle below for others to see. You can also do so, and an account isn’t necessary.

As you can see, you leave the JS section for code empty. You’ll learn JS later, of course.

All in all great work!

Nicolas

2 Likes

Thanks, I’ll do that for the next project!

Thanks for all those tips!

1 Like

Thank you for sharing the jsfiddle website! I’m just starting the first certification project and was looking for something like this.

3 Likes

Your form turned out great, congrats on finishing it! I can’t wait to see how mines turn out, love the colors you chose and the glow in the submit button is awesome :slight_smile:

1 Like

I’m glad someone found the information helpful. In general, this is how it goes when it comes to hosting webpages as an aspiring web dev:

  • JSFiddle, CodePen or something similar for smaller, less complex projects like fCC’s certification projects. Also good for building and saving specific components of a larger website you’re working on, like for example a slideshow, a visual effect or a hover animation.

  • GitHub Pages for larger, more official projects. These usually contain multiple files and pages and the site is hosted like a real, official site. This is the best place to showcase your best ideas, your original ideas. Entire websites go here — your best work.

  • If you have created a real, successful site for an actual purpose beyond showcasing your dev skills, like say a blog, or an official website for a business etc. etc., you will want to use a hosting company, You will need a domain name as the website’s digital identity that allows internet users to access your website easily, and web hosting to store your website’s data (code and media like photos, videos, audio etc.).

I hope that helps too in case anyone was wondering. And as I too am a beginner and haven’t hosted a real website yet myself, please correct or add on to this as needed if you happen to know more.

Happy coding!

2 Likes

Thanks, share yours too once it is finished !

1 Like