Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <section class="section section-form">
    <br />
    <form>
        <h3>Contact Information</h3>
        <div class="input-group error">
            <label for="eamil">Email Address</label>
            <input id="eamil" type="text" placeholder="Input your email address" />
            <div class="message error">
                <i></i>
                <div class="message-content">
                    Useful and easy to understand validation feedback
                </div>
            </div>
        </div>
        <div class="input-group">
            <label for="details">Details</label>
            <textarea id="details" cols="10" placeholder="Input details">Yesterday, at band camp, I noticed that my drive was no longer working as expected.In fact, it was working in a very unexpected way. Can you please make sure it will work as expected again?</textarea>

            <div class="message">
                <i></i>
                <div class="message-content">
                    Information to help the user provide the right input
                </div>
            </div>
        </div>
        <div class="input-group">
            <label>Are you happy?</label>
            <label class="inline-radio" for="yes">
                <input id="yes" type="radio" name="radio" /> Yes
            </label>
            <label class="inline-radio" for="no">
                <input id="no" type="radio" name="radio" /> No
            </label>

        </div>
        <div class="input-group">
            <label>What do you link?</label>
            <label class="inline-checkbox" for="money">
                <input id="money" type="checkbox" /> Money
            </label>
            <label class="inline-checkbox" for="power">
                <input id="power" type="checkbox" /> Power
            </label>
            <label class="inline-checkbox" for="free">
                <input id="free" type="checkbox" /> Free
            </label>
        </div>
        <div class="input-group">
            <label>
                <input type="checkbox" /> I have read and understood the <a href="#">Data Protection act compliance statement</a>
            </label>
        </div>
        <div>
            <input type="submit" class="btn btn-red btn-medium" value="Submit" />
        </div>
    </form>
    
</section>
              
            
!

CSS

              
                body{
  font-size:16px;
}
.section-form {
    max-width: 960px;
    margin:0 auto;
  .btn{
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    text-decoration: none;
    line-height: normal;
    color: #fff;
    cursor: pointer;
    user-select: none;
    border: none;
    border-radius: 0;
    transition: background 150ms ease-in;
    background-color: #A20520;
    &:hover{
      background-color: #000;
    }
    &.btn-medium {
    font-size: 1rem;
    padding: .5rem 2rem .6rem;
  }
  }
    .input-group {
        margin-bottom: 1.5rem;

        label {
            color: #282828;
            display: block;
            font-size: 14px;

            &.inline-radio,
            &.inline-checkbox {
                display: inline-block;
                margin-right: 1.5rem;
            }
        }

        input, textarea {
            border: none;
            border-bottom: 1px solid #999;
            line-height: 1.5rem;
            padding-bottom: 0.4rem;

            &:focus {
                outline: none;
            }

            width: 100%;
        }

        textarea {
            display: block;
        }

        input[type=radio], input[type=checkbox] {
            width: auto;
            margin-right: .2rem;
        }
    }

    .message {
        i {
            border-top: 2px solid #fff;
            border-left: 8px solid #fff;
            border-right: 8px solid #fff;
            border-bottom: 8px solid #DFDDDD;
            display: block;
            float: left;
            margin-left: 0.5rem;
        }

        .message-content {
            background-color: #DFDDDD;
            float: none;
            clear: both;
            padding: .5rem;
            font-size: 14px;
        }

        &.error {
            display: none;

            i {
                border-bottom: 8px solid #ca2026;
            }

            .message-content {
                background-color: #ca2026;
                color: #fff;
            }
        }
    }
    /*Validation error*/
    .error {
        label {
            color: #ca2026;
        }

        .message.error {
            display: block;
        }

        input, textarea {
            border-bottom-color: #ca2026;
          color:#ca2026;
        }
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console