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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

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