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

              
                <div class="site-wrapper">
	<section class="newsletter">
		<div class="newsletter__copy">
			<h3>Subscribe to WWD’s newsletters</h3>
			<p>Get all the top news stories and alert straight to your inbox.</p>
		</div>
		<form class="newsletter__form js-newsletter-form">
			<input class="newsletter__form-input" type="email" placeholder="Email Address">
			<input class="newsletter__form-submit" type="submit" value="Sign Up">
		</form>
	</section>
</div>
              
            
!

CSS

              
                // Notes:
// - Mobile first – layout is added in media query to take advantage of default element stacking.
// - Width values are *not* coded in static px or rem values.
// - These are structural styles only. Please add visual design properties in the appropriate rules.
// - This is a *suggestion* – check the existing codebase for reusable markup and styling patterns.
// - If you have feedback, we are open to it! Please contact @laras126 on the PMC Slack, or lschenck@pmc.com.

.newsletter {
	background-color: #EEE; // Refer to mockup or existing Sass variables
	padding: 15px; // Refer to spacing value in mockup
	
	// Refer to existing media query patterns in codebase
	@media( min-width: 800px ) {	
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	
	&__form {
		display: flex;
		justify-content: space-between;
		min-width: 48%;
	}
	
	&__form-input {
		flex-basis: 75%;
		margin-right: 15px; // Refer to mockup for this value
	}
}


// Base styles - not for reference.
.site-wrapper {
	max-width: 800px;
	margin: 30px auto;
}
              
            
!

JS

              
                // Note:
// - A separate .js-* prefixed selector is used to handle JS interactions.
// - Using jQuery

$('.js-newsletter-form').on('submit', (e) => {
	e.preventDefault(); // Prevent a page reload for this example and for asynchronous calls.
	$('.newsletter__form').html('<p>Thank you!</p>');
});
              
            
!
999px

Console