Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

  <h1 id="title" class="title">The Survey Form</h1>
  <form id="survey-form" class="survey-form">
    <p id="description" class="form-description">
      Please fill up the form.
    </p>
    <label class="form-label" for="name" id="name-label">Name <span class="form-label-cursive">(required)</span>:</label>
    <input class="form-input" placeholder="Enter your name" type="text" id="name" name="name" required>
    <label class="form-label" for="email" id="email-label">Email <span class="form-label-cursive">(required)</span>:</label>
    <input class="form-input" placeholder="Enter your email" type="email" id="email" name="email" required>
    <label class="form-label" for="number" id="number-label">Age <span class="form-label-cursive">(required)</span>:</label>
    <input class="form-input" placeholder="18" type="number" id="number" name="age" min="0" max="150" required>

    <label class="form-label" for="dropdown">Choose your experience level:</label>
    <select class="form-dropdown" id="dropdown" name="experience">
      <option value="no experience" selected >No experience</option>
      <option value="beginner">Beginner</option>
      <option value="intermediate">Intermediate</option>
      <option value="advanced">Advanced</option>
      <option value="expert">Expert</option>
    </select>

    <fieldset class="form-fieldset">
      <legend class="form-label">Do you want to receive our newsletter? </legend>
      <div class="form-field-background">
        <div>
          <input type="radio" id="n-yes" value="n-yes" name="newsletter" checked>
          <label for="n-yes">Yes</label>
        </div>
        <div>
          <input type="radio" id="n-no" value="n-no" name="newsletter">
          <label for="n-no">No</label>
        </div>
        <div>
          <input type="radio" id="n-later" value="n-later" name="newsletter">
          <label for="n-later">Ask&nbsp;later</label>
        </div>
      </div>
    </fieldset>

    <fieldset class="form-fieldset">
      <legend class="form-label"> Select your interest areas:</legend>
      <div class="form-field-background checkboxes">
        <div>
          <input type="checkbox" name="subjects" id="c-rwd" value="s-all" checked>
          <label for="c-rwd">Responsive Web Design</label>
        </div>
        <div>
          <input type="checkbox" name="subjects" id="c-js" value="s-all" checked>
          <label for="c-js">JavaScript Algorithms And Data Structures</label>
        </div>
        <div>
          <input type="checkbox" name="subjects" id="c-fel" value="s-all" checked>
          <label for="c-fel">Front End Libraries</label>
        </div>
        <div>
          <input type="checkbox" name="subjects" id="c-dv" value="s-all" checked>
          <label for="c-dv">Data Visualisation</label>
        </div>
        <div>
          <input type="checkbox" name="subjects" id="c-is" value="s-all" checked>
          <label for="c-is">Information Security And Quality Assurance</label>
        </div>
        <div>
          <input type="checkbox" name="subjects" id="c-cip" value="s-all" checked>
          <label for="c-cip">Coding Interview Prep</label>
        </div>
      </div>
    </fieldset>
    <div class="form-textarea-box">
      <label for="optional" class="form-label">You can add optional information here(not required):</label>
      <textarea class="form-textarea" id="optional" name="optional" placeholder="Max 256 characters" maxlength="256" rows="3"></textarea>
    </div>
    <input type="submit" class="form-submit-btn" id="submit" value="Send">
  </form>
  <footer class="footer">
    <span>Created by <a class="link" target="_blank" href="http://mybytes.pl/">Sebastian Sporek</a></span>
  </footer>
            
          
!

CSS

            
              * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: 'Lato', sans-serif;
  font-size: 20px;
  --purple: #4C0036;
  --lightblue: #0BE2E5;
  --darkblue: #053233;
  --lightgray: #ccc;
  --darkpurple: #330525;
  --tan: #8C790E;
}

body {
  background-color: var(--lightgray);
}

.title {
  color: var(--purple);
  text-align: center;
  font-size: 1.5rem;
  padding: 1rem;
}

.survey-form {
  background-color: var(--lightblue);
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.form-description {
  color: var(--darkblue);
  font-size: 1.25rem;
  text-align: center;
  padding-bottom: 0.5rem;
}

.form-label {
  font-size: 1rem;
  color: var(--darkblue);
  padding: 0.5rem 0;
  text-align: left;
  display: block;
  margin-right: auto;
}

.form-label-cursive {
  font-style: italic;
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid var(--darkblue);
  background-color: var(--lightgray);
  color: var(--darkblue);
  outline: none;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
}

.form-input::placeholder {
  color: var(--darkblue);
  opacity: 1;
  font-style: italic;
}

.form-input:invalid {
  border: 2px solid red;
}

.form-input:valid {
  border: 2px solid var(--darkblue);
}

.form-dropdown {
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  padding: 0.5rem;
  width: 100%;
  background-color: var(--lightgray);
  color: var(--darkblue);
}

.form-fieldset {
  width: 100%;
  border: 0;
  margin-left: auto;
  margin-bottom: 0.5rem;
}

.form-fieldset label {
  margin-right: 1rem;
  margin-left: 0.25rem;
  color: var(--darkblue);
}

.form-field-background {
  background-color: var(--lightgray);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}
.form-field-background div {
  margin: 0.25rem 0;
}

.form-textarea-box {
  margin-right: auto;
}

.form-textarea {
  color: var(--darkblue);
  background-color: var(--lightgray);
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  outline: none;
  border: 0;
}

.form-submit-btn {
  margin: 1rem auto;
  font-size: 1.25rem;
  color: var(--lightgray);
  padding: 0.5rem 1rem;
  letter-spacing: 0.1rem;
  border: 0;
  border-radius: 0.25rem;
  background-color: var(--darkpurple);
  transition: all 0.3s linear;
}

.form-submit-btn:hover {
  cursor: pointer;
  box-shadow: 0px 0px 0px 2px var(--lightgray), 0px 0px 0px 4px var(--darkpurple);
}

.footer {
  text-align: center;
  font-style: italic;
  font-size: 0.75rem;
  margin: 0 auto;
  padding: 0.25rem;
  color: var(--tan);
  max-width: 600px;
  letter-spacing: 1px;
}

.footer .link {
  color: var(--tan);
}

@media (min-width: 360px) {
  .survey-form {
    max-width: 600px;
    margin: 0 auto;
  }
  .form-field-background {
    flex-direction: row;
  }
  .checkboxes {
    flex-direction: column;
  }
  .form-textarea-box {
    margin-left: auto;
  }
}

            
          
!

JS

            
              
            
          
!
999px

Console