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.

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

              
                .container
  .row
    .col-md-12
      div#root
              
            
!

CSS

              
                body
  padding: 50px
  
.btn
  background-color: rgba(36, 41, 44, .9)
  border: none
  width: 100%
  text-align: center
  padding: 14px
  border-radius: 4px
  color: white

.fb
  @extend .btn
  background-color: rgb(51, 89, 157)

.input
  background: rgba(241, 241, 241, .7)
  width: 100%
  padding: 14px
  border-radius: 4px
  border: 0
  color: #3E3E3E

              
            
!

JS

              
                // Example JS object used for CSS styling
const styles = {
  facebookBtn: {
    backgroundColor: 'rgb(51, 89, 157)'
  },
  form: {
    textAlign: 'center'
  }
}

class Login extends React.Component {
  handleOnSubmit = (e) => {
    e.preventDefault();
    console.log('Submitted!');
  };
  render() {
    return (
        <form style={styles.form} onSubmit={this.handleOnSubmit}>
          <h4>Welcome Back!</h4>
          <div className='form-group row'>
            <input className='input' type='text' placeholder='Email'/>
          </div>
          <div className='form-group row'>
            <input className='input' type='password' placeholder='Password'/>
          </div>
          <div className='form-group row'>
            <button className='btn' type='submit'>Log In</button>
          </div>
          <div className='form-group row'>
            <button className='fb' type='submit'>Connect with Facebook</button>
          </div>
        </form>
      
    )
  }
}

class Form extends React.Component {
  render () {
    const {children, title} = this.props
    return (
      <div className='col-md-6 mx-auto'>
        <header>
          <h1>{title}</h1>
        </header>
        {children}
      </div>
    )
  }
}


ReactDOM.render(
  <Form children={ <Login /> } />,
  document.getElementById('root')
);
              
            
!
999px

Console