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

              
                <h1>Larger Flexbox Form</h1>
<form class="cs-form cs-message">

    <label for="first-name">First Name: </label>
    <input type="text" class="field field1" placeholder="First Name" name="first-name" id="first-name">

    <label for="last-name">Last Name: </label>
    <input type="text" class="field field2" placeholder="Last Name" name="last-name" id="last-name">

    <label for="zip-code">Zip Code: </label>
    <input type="text" class="field field3" placeholder="Zip Code" name="zip-code" id="zip-code">

    <label for="spirit-animal">Spirit Animal: </label>
    <input type="text" class="field field4" placeholder="Spirit Animal" name="spirit-animal" id="spirit-animal">

    <label for="lottery">What will you do with your lottery winnings? </label>
    <textarea class="textarea" rows="5" cols="20" placeholder="What will you do with your lottery winnings?" name="lottery" id="lottery"></textarea>

    <button class="button" type="submit">
        OK
    </button>

</form>

              
            
!

CSS

              
                $color-primary: #458599;

body {
	padding: 2%;
	color: #444;
	max-width: 980px;
	margin: 0 auto;
	background-color: #eaeaea;
}

label {
	position: absolute;
  clip: rect(1px 1px 1px 1px); 
  clip: rect(1px, 1px, 1px, 1px);
}
form {
	display: flex;
	flex-flow: row wrap;
}
.field, .textarea {
	margin: 0 .5em 1em 0;
	padding: .5em 1em;
	border: 1px solid #CCC;
}
.field {
	flex: 1 0 40%; //flex magic
	width: 45%;
	float: left;
}
.textarea {
	flex: 1 0 90%;
	width: 90%;
}
.button {
	padding: .5em 1em;
	border: 1px solid #CCC;
	background-color: $color-primary;
	color: #FFF;
}
              
            
!

JS

              
                /*

Based on talk by Zoe Gillenwater at CSSconf 2015 https://www.youtube.com/watch?v=_98SE8WUvLk

http://www.slideshare.net/zomigi/enhancing-responsiveness-with-flexbox-css-conf-eu-2015

*/
              
            
!
999px

Console