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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML

              
                <header class='header'>
  <h1 id='title' class='header__title'>Climate Change</h1>
</header>
<main class='page-content'>
  <p id='description' class='page-description'>Thank you for taking the time to help us improve</p>
  <h2 class='page-motto'>Together we can change the <i class='fas fa-globe-europe page-motto__icon'></i></h2>
  <form id='survey-form' class='form'>
    <div class='form-group'>
      <label id='name-label' class='form-group__label' for='name'>Name</label>
      <input id='name' class='form-group__input' name='name' type='text' placeholder='John Doe' required />
    </div>
    <div class='form-group'>
      <label id='email-label' class='form-group__label' for='email'>Email</label>
      <input id='email' class='form-group__input' name='email' type='email' placeholder='doe.john@email.it' required />
    </div>
    <div class='form-group'>
      <label id='number-label' class='form-group__label' for='number'>Age (optional)</label>
      <input id='number' class='form-group__input' name='number' type='number' min='15' max='100' placeholder='Must be between 15 and 100' />
    </div>
    <div class='form-group'>
      <label class='form-group__label' for='dropdown'>Where do you live?</label>
      <select id='dropdown' class='form-group__dropdown' name='dropdown'>
        <option class='form-group__dropdown__item' value='' disabled selected>Select country</option>
        <option class='form-group__dropdown__item' value='africa'>Africa</option>
        <option class='form-group__dropdown__item' value='china'>China</option>
        <option class='form-group__dropdown__item' value='denmark'>Denmark</option>
        <option class='form-group__dropdown__item' value='england'>England</option>
        <option class='form-group__dropdown__item' value='finland'>Finland</option>
        <option class='form-group__dropdown__item' value='france'>France</option>
        <option class='form-group__dropdown__item' value='germany'>Germany</option>
        <option class='form-group__dropdown__item' value='italy'>Italy</option>
        <option class='form-group__dropdown__item' value='japan'>Japan</option>
        <option class='form-group__dropdown__item' value='north-america'>North America</option>
        <option class='form-group__dropdown__item' value='norway'>Norway</option>
        <option class='form-group__dropdown__item' value='russia'>Russia</option>
        <option class='form-group__dropdown__item' value='south-america'>South America</option>
        <option class='form-group__dropdown__item' value='spain'>Spain</option>
        <option class='form-group__dropdown__item' value='sweden'>Sweden</option>
        <option class='form-group__dropdown__item' value='other'>Other</option>
      </select>
    </div>
    <div class='form-group'>
      <fieldset class='field'>
        <legend class='field__legend'><label class='field__legend__label'>Have you already participated in any demonstrations on Climate Change?</label></legend>
        <div class='radios-container'>
          <div class='radio-container'>
            <input id='sure' class='radio-container__input' name='user-past-participation' type='radio' value='sure' />
            <label class='radio-container__label' for='sure'>Sure</label>
          </div>
          <div class='radio-container'>
            <input id='let-us-say' class='radio-container__input' name='user-past-participation' type='radio' value='let-us-say' />
            <label class='radio-container__label' for='let-us-say'>Let's say</label>
          </div>
          <div class='radio-container'>
            <input id='not-yet' class='radio-container__input' name='user-past-participation' type='radio' value='not-yet' />
            <label class='radio-container__label' for='not-yet'>Not yet</label>
          </div>
        </div>
      </fieldset>
    </div>
    <div class='form-group'>
      <fieldset class='field'>
        <legend class='field__legend'><label class='field__legend__label'>What should we improve? (Check all that apply)</label></legend>
        <div class='checkboxes-container'>
          <div class='checkbox-container'>
            <input id='demonstrations' class='checkbox-container__input' name='user-opinion' type='checkbox' value='demonstrations' />
            <label class='checkbox-container__label' for='demonstrations'>Demonstrations</label>
          </div>
          <div class='checkbox-container'>
            <input id='brand-reputation' class='checkbox-container__input' name='user-opinion' type='checkbox' value='brand-reputation' />
            <label class='checkbox-container__label' for='brand-reputation'>Brand Reputation</label>
          </div>
          <div class='checkbox-container'>
            <input id='perseverance' class='checkbox-container__input' name='user-opinion' type='checkbox' value='perseverance' />
            <label class='checkbox-container__label' for='perseverance'>Perseverance</label>
          </div>
          <div class='checkbox-container'>
            <input id='social-presence' class='checkbox-container__input' name='user-opinion' type='checkbox' value='social-presence' />
            <label class='checkbox-container__label' for='social-presence'>Social Presence</label>
          </div>
          <div class='checkbox-container'>
            <input id='other' class='checkbox-container__input' name='user-opinion' type='checkbox' value='other' />
            <label class='checkbox-container__label' for='other'>Other</label>
          </div>
        </div>
      </fieldset>
    </div>
    <div class='form-group form-group--txt'>
      <label class='form-group__label' for='idea'>Tell us your idea!</label>
      <textarea id='idea' class='form-group__textarea' name='idea' placeholder='I think that...'></textarea>
    </div>
    <div class='form-group form-group--btn'>
      <button id='submit' class='form-group__button' type='submit'>Submit</button>
    </div>
  </form>
</main>
<footer class='footer'>
  <span class='footer__copyright'>HawksSpawn &copy; 2021</span>
  <a class='footer__social-link' href='https://www.freecodecamp.org/hawksspawn' target='_blank' rel='noopener noreferrer'><i class='fab fa-free-code-camp'></i></a>
  <a class='footer__social-link' href='https://codepen.io/hawksspawn' target='_blank' rel='noopener noreferrer'><i class='fab fa-codepen'></i></a>
  <a class='footer__social-link' href='https://github.com/HawksSpawn' target='_blank' rel='noopener noreferrer'><i class='fab fa-github'></i></a>
</footer>
              
            
!

CSS

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

/* ---------------------------- Mobile S - 320px ---------------------------- */
/* ---------------------------- Mobile M - 375px ---------------------------- */
/* ---------------------------- Mobile L - 425px ---------------------------- */

:root {
  /* https://www.color-name.com/ */
  --azure: #0096ff;
  --beige: #f5f5dc;
  --mustard: #ffdb51;
  --sapphire: #005ab4;
  --vivid-sky-blue: #00e1ff;
  font-size: 8px;
}

body::before {
  top: 0;
  left: 0;
  content: "";
  z-index: -1;
  width: 100%;
  height: 100%;
  position: fixed;
  background: var(--sapphire, dodgerblue);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: linear-gradient(
      to right top,
      rgba(95, 251, 241, 0.5),
      rgba(0, 224, 242, 0.5),
      rgba(0, 195, 240, 0.5),
      rgba(0, 164, 230, 0.5),
      rgba(0, 133, 212, 0.5),
      rgba(54, 107, 184, 0.5),
      rgba(68, 83, 154, 0.5),
      rgba(72, 59, 123, 0.5),
      rgba(70, 41, 84, 0.5),
      rgba(55, 27, 51, 0.5),
      rgba(33, 17, 26, 0.5),
      rgba(0, 0, 0, 0.5)
    ),
    url("https://github.com/HawksSpawn/images-for-fcc/blob/main/polar-bear-climate-change.jpg?raw=true");
}

.header {
  padding: 0.8rem;
}

.header__title {
  font-size: 3.5rem;
  text-align: center;
  color: var(--mustard, gold);
  text-shadow: 2px 1px 1px black;
}

.page-content {
  margin: 0 auto;
}

.page-description {
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--beige, white);
  text-shadow: 2px 1px 4px black;
}

.page-motto {
  font-size: 2.25rem;
  text-align: center;
  color: var(--mustard, gold);
  text-shadow: 2px 1px 4px black;
}

.page-motto__icon {
  margin-left: 0.5rem;
}

.form {
  width: 90%;
  padding: 1.5rem;
  margin: 2rem auto;
  border-radius: 0.75rem;
  outline: 1px solid black;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 1px black inset;
  border: 2px solid var(--mustard, gold);
}

.form-group {
  margin-bottom: 2.35rem;
}

.form-group__label {
  font-size: 2rem;
  cursor: pointer;
  letter-spacing: 1px;
  color: var(--beige, white);
  font-family: "EB Garamond", serif;
}

.form-group:focus-within .form-group__label {
  color: var(--vivid-sky-blue, cyan);
}

.form-group__input,
.form-group__dropdown,
.form-group__textarea {
  width: 100%;
  border: none;
  display: block;
  height: 3.5rem;
  cursor: pointer;
  margin-top: 0.8rem;
  padding-left: 0.55rem;
  border-radius: 0.25rem;
  background: var(--beige, white);
  outline-color: var(--vivid-sky-blue, cyan);
}

.form-group__dropdown {
  padding: 0;
}

.field {
  border: none;
}

.field__legend {
  font-size: 2rem;
  letter-spacing: 1px;
  color: var(--beige, white);
  font-family: "EB Garamond", serif;
}

.radio-container,
.checkbox-container {
  display: flex;
  margin-top: 1.5rem;
  align-items: center;
}

.radio-container__input,
.checkbox-container__input {
  cursor: pointer;
  margin-right: 0.75rem;
}

.radio-container__label,
.checkbox-container__label {
  cursor: pointer;
  font-size: 1.7rem;
  letter-spacing: 1px;
  color: var(--beige, white);
}

.radio-container__label:hover,
.checkbox-container__label:hover {
  color: var(--vivid-sky-blue, cyan);
}

.form-group__textarea {
  width: 100%;
  height: 10rem;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 5rem;
  padding: 0.5rem 0.75rem;
}

.form-group--btn {
  text-align: center;
}

.form-group__button {
  width: 40%;
  border: none;
  padding: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background: var(--mustard, gold);
}

.form-group__button:hover {
  cursor: pointer;
  background: rgba(255, 219, 81, 0.8);
}

.footer {
  display: flex;
  padding: 0.8rem;
  margin-top: 1.5rem;
  align-items: center;
  justify-content: space-around;
}

.footer__copyright {
  font-size: 1.35rem;
  font-family: "Sigmar One", cursive;
}

.footer__social-link {
  color: black;
}

.footer__social-link:hover {
  opacity: 0.8;
  color: var(--beige, white);
}

.fab {
  font-size: 2rem;
}

/* ---------------------------- Tablet - 768px ---------------------------- */

@media only screen and (min-width: 768px) {
  :root {
    font-size: 9.5px;
  }

  .form {
    width: 70%;
  }

  .form-group__textarea {
    height: 14rem;
  }
}

/* ---------------------------- Laptop - 1024px ---------------------------- */

@media only screen and (min-width: 1024px) {
  :root {
    font-size: 10px;
  }

  .form {
    padding: 1.5rem 3rem;
  }

  .form-group:not(.form-group--btn, .form-group--txt) {
    display: flex;
    text-align: right;
    align-items: center;
  }

  .form-group--txt {
    display: flex;
    text-align: right;
    align-items: flex-start;
  }

  .form-group__label {
    width: 250px;
    margin-right: 3rem;
  }

  .field__legend {
    float: left;
    width: 170px;
  }

  .radios-container,
  .checkboxes-container {
    float: left;
    margin: -1rem 0 0 3.25rem;
  }
}

/* --------------------------- Laptop M - 1200px --------------------------- */

@media only screen and (min-width: 1200px) {
  :root {
    font-size: 10.5px;
  }

  .form {
    width: 60%;
  }

  .field__legend {
    width: 178px;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console