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 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

              
                <body>
  <header>
    <h1 id="title">Tell us about your coffee</h1>
    <p id="description">
      from the people who who brought you,
      <a target="_blank" href="https://codepen.io/michaelgainford/full/ZEedpQx">
        my tribute to coffee</a>
    </p>
  </header>
  <main>
    <form id="survey-form">
      <!-- Name-->
      <div class="form__group">
        <label for="name" id="name-label">What is your name? </label>
        <input type="text" name="name" id="name" class="form__input" placeholder="please enter your name" required />
      </div>
      <!-- Email address-->
      <div class="form__group">
        <label for="email" id="email-label">
          What is your e-mail address?
        </label>
        <input type="email" name="email" id="email" class="form__input" placeholder="please enter your email address" required />
      </div>
      <!-- Like it or not?-->
      <div class="form__group">
        <label for="email" id="radio-label"> Do you like coffee? </label>
        <div id="radio__group">
          <label>Yes
            <input type="radio" name="radio" id="yes" class="radio" value="yes" required />
          </label>
          <label>No
            <input type="radio" name="radio" id="no" class="radio" value="no" required />
          </label>
        </div>
      </div>
      <!-- Does it matter if it's black or white?-->
      <div class="form__group">
        <label for="how-do-you-like-it">How do you take your's?</label>
        <div id="checkbox__group">
          <label for="no-milk" id="check-label">No milk
            <input type="checkbox" name="what-colour" id="no-milk" value="no-milk" class="checkbox" /></label>
          <label for="some-milk" id="check-label">Some milk
            <input type="checkbox" name="what-colour" id="some-milk" value="some-milk" class="checkbox" /></label>
          <label for="milky" id="check-label">Milky
            <input type="checkbox" name="what-colour" id="milky" value="milky" class="checkbox" /></label>
        </div>
      </div>
      <!-- Number of coffees-->
      <div class="form__group">
        <label for="number" id="number-label">
          How many cups do you drink per day?
        </label>
        <input type="number" name="number" id="number" class="form__input" min="0" max="100" placeholder="Enter a number between 0 and 100" />
      </div>
      <!-- Favourite type of coffee-->
      <div class="form__group">
        <label for="select" id="favourite-label">
          What is your favourite drink?
        </label>
        <select id="dropdown" name="dropdown" class="form__input" required>
          <option class="disabled" disabled selected value>
            Pick one...
          </option>
          <option value="americano">Americano</option>
          <option value="mocha">Mocha</option>
          <option value="cappuccino">Cappuccino</option>
          <option value="espresso">Espresso</option>
          <option value="latte">Latte</option>
          <option value="other">Other</option>
        </select>
      </div>
      <!-- Textarea-->
      <div class="form__group">
        <label for="message" id="message-label">Anything to say?</label>
        <textarea id="message" name="message" placeholder="What would you like to say?" class="form__input"></textarea>
      </div>
      <!-- Submit-->
      <div class="form__group">
        <input id="submit" type="submit" value="Send your message" />
      </div>
    </form>
  </main>
  <footer>
    <p>
      Built by
      <a target="_blank" href="https://michaelgainford.co.uk">Michael</a>
    </p>
  </footer>
</body>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Staatliches&display=swap");
:root {
  --clr1: #402218;
  --clr2: #865439;
  --clr3: #c68b59;
  --clr3-trans: rgba(198, 139, 89, 0.2);
  --clr4: #d7b19d;
  --clr-black-transparent: rgba(0, 0, 0, 0.8);
  --ff: Staatliches, sans-serif;
}

* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  font-family: var(--ff);
  margin: 0;
  padding: 0;
}

::-webkit-input-placeholder {
  opacity: 1;
}

::-moz-placeholder {
  opacity: 1;
}

:-ms-input-placeholder {
  opacity: 1;
}

::-ms-input-placeholder {
  opacity: 1;
}

::placeholder {
  opacity: 1;
}

body {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  background-blend-mode: multiply;
  background-color: var(--clr-black-transparent);
  background-image: url("https://source.unsplash.com/TD4DBagg2wE/1920x1464");
  background-size: cover;
  color: var(--clr4);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  font-family: var(--ff);
  font-size: 10px;
  line-height: 1.2rem;
  min-height: 100vh;
  padding: 2rem 0;
  text-align: center;
}
body > * {
  width: 100%;
}
@media (min-width: 600px) {
  body {
    padding: 2rem;
  }
}

header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}
header h1 {
  color: var(--clr3);
  font-size: 1.4rem;
  letter-spacing: 0.2rem;
  line-height: 1.6rem;
  margin-bottom: 0rem;
  text-transform: uppercase;
}
header p {
  color: var(--clr4);
  font-size: 0.84rem;
  letter-spacing: 0.01rem;
  margin-bottom: 2rem;
  text-transform: lowercase;
}
header p a {
  color: inherit;
}
header p a:hover {
  text-decoration: none;
}
@media (min-width: 900px) {
  header h1 {
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
  }
  header p {
    font-size: 1.2rem;
  }
}

main {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  padding-top: 2.4rem;
}

form {
  background-color: var(--clr-black-transparent);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  max-width: 1000px;
  padding: 2.4rem 1.8rem;
  width: 100%;
}
@media (min-width: 900px) {
  form {
    border-radius: 0.5rem;
    padding: 3rem;
    width: 100%;
  }
}
form .form__group {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  padding-bottom: 3rem;
  /* button */
}
@media (min-width: 900px) {
  form .form__group {
    padding-bottom: 4rem;
  }
}
form .form__group label {
  border-bottom: 1px solid var(--clr3-trans);
  color: var(--clr3);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  font-size: 0.9rem;
  font-weight: 100;
  letter-spacing: 0.05rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.2rem;
  text-align: left;
  text-transform: lowercase;
  width: 100%;
}
form .form__group input,
form .form__group textarea,
form .form__group select {
  border-radius: 0.25rem;
  border-width: 3px;
  color: var(--clr1);
  font-family: var(--ff);
  letter-spacing: 0.05rem;
  padding: 2rem 0;
  outline: 0;
  -webkit-transform: background-color 1s, border 1s;
  transform: background-color 1s, border 1s;
  width: 100%;
}
form .form__group select {
  color: var(--clr3);
}
form .form__group select.form__input {
  color: var(--clr4);
  padding: 1.5rem 0 1.5rem 2rem;
}
form .form__group input::-webkit-input-placeholder,
form .form__group textarea::-webkit-input-placeholder {
  color: var(--clr4);
}
form .form__group input::-moz-placeholder,
form .form__group textarea::-moz-placeholder {
  color: var(--clr4);
}
form .form__group input:-ms-input-placeholder,
form .form__group textarea:-ms-input-placeholder {
  color: var(--clr4);
}
form .form__group input::-ms-input-placeholder,
form .form__group textarea::-ms-input-placeholder {
  color: var(--clr4);
}
form .form__group input::placeholder,
form .form__group textarea::placeholder {
  color: var(--clr4);
}
form .form__group .form__input {
  background: var(--clr1);
  border: 3px solid var(--clr3);
  border-radius: 0.4rem;
  color: var(--clr4);
  display: block;
  font-size: 0.84rem;
  height: 3rem;
  padding: 1rem 1rem;
  -webkit-transition: background-color 1s, color 500ms, border-color 1s;
  transition: background-color 1s, color 500ms, border-color 1s;
}
@media (min-width: 600px) {
  form .form__group .form__input {
    font-size: 1rem;
  }
}
@media (min-width: 900px) {
  form .form__group .form__input {
    height: 5rem;
    font-size: 1.2rem;
    padding: 1.2rem 2rem;
  }
}
form .form__group .form__input:hover {
  background-color: var(--clr3);
  border-color: var(--clr1);
  color: var(--clr1);
}
form .form__group .form__input:hover::-webkit-input-placeholder {
  color: var(--clr2);
}
form .form__group .form__input:hover::-moz-placeholder {
  color: var(--clr2);
}
form .form__group .form__input:hover:-ms-input-placeholder {
  color: var(--clr2);
}
form .form__group .form__input:hover::-ms-input-placeholder {
  color: var(--clr2);
}
form .form__group .form__input:hover::placeholder {
  color: var(--clr2);
}
form .form__group .form__input:focus {
  background-color: var(--clr3);
  border-color: var(--clr1);
  color: var(--clr1);
}
form .form__group textarea.form__input {
  height: 8rem;
  resize: both;
}
form .form__group input[type="submit"] {
  background: var(--clr3);
  border: 3px solid var(--clr3);
  border-radius: 0.4rem;
  color: var(--clr1);
  cursor: pointer;
  font-family: var(--ff);
  font-size: 1.25rem;
  letter-spacing: 0.1rem;
  padding: 1.6rem 0;
  -webkit-transition: background-color 1s, border-color 1s;
  transition: background-color 1s, border-color 1s;
}
@media (min-width: 600px) {
  form .form__group input[type="submit"] {
    font-size: 1.5rem;
    padding: 3rem 0;
  }
}
@media (min-width: 900px) {
  form .form__group input[type="submit"] {
    font-size: 1.8rem;
    padding: 5rem 0;
  }
}
form .form__group input[type="submit"]:focus {
  background-color: var(--clr4);
  border-color: var(--clr4);
  color: var(--clr1);
}
form .form__group input[type="submit"]:hover {
  background-color: var(--clr4);
  border-color: var(--clr4);
  color: var(--clr1);
}

/* Radio buttons group */
#radio__group {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
}
#radio__group > * {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding-right: 4.2rem;
  width: 33%;
}
@media (min-width: 900px) {
  #radio__group > * {
    width: 25%;
  }
}
#radio__group label {
  border-bottom: 0;
}
#radio__group label .radio {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  margin-left: -1rem;
  text-align: left;
}
@media (min-width: 900px) {
  #radio__group label .radio {
    margin-left: -3rem;
  }
}

/* Checkbox group */
#checkbox__group {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
  -ms-flex-pack: distribute;
  justify-content: space-around;
}
#checkbox__group label {
  border-bottom: 0;
  font-size: 0.84rem;
  padding: 0 2rem 1rem 0;
  text-align: center;
}
#checkbox__group label input {
  margin-left: 0.5rem;
  margin-right: 1rem;
  width: auto;
}

footer p {
  color: var(--clr3);
  font-size: 1rem;
  padding: 1rem 0;
}
footer p a {
  color: var(--clr3);
}
footer p a:hover {
  text-decoration: none;
}

/*# sourceMappingURL=style.css.map */

              
            
!

JS

              
                
              
            
!
999px

Console