cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              html, body {
  height: 100%;
}

body {
  background: #333333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Helvetica Neue;
}

h1 {
  font-size: 2em;
  color: #eeeeee;
  display: inline-block;
}

a {
  color: white;
}

p {
  margin-top: 1em;
  text-align: center;
  color: #aaaaaa;
}

            
          
!
            
              /*
 * A simple React component
 */
class Application extends React.Component {
  constructor(props){
    super(props);
    this.state={
    open:false
    }
  }
  _handleDropDownClick(){
    this.setState({
      open:!this.state.open
    })
  }
  render() {
    var dropDownClasses = this.state.open ? "dropdown open" : "dropdown"; 
    return ( <div onClick={this._handleDropDownClick.bind(this)} className={dropDownClasses}>
        <button className="btn btn-default" type="button">
          Dropdown
          <span className="caret" />
        </button>
        <ul className="dropdown-menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Another action</a></li>
          <li><a href="#">Something else here</a></li>
          <li role="separator" className="divider" />
          <li><a href="#">Separated link</a></li>
        </ul>
      </div>);
  }
}

/*
 * Render the above component into the div#app
 */
React.render(<Application />, document.getElementById('app'));
            
          
!
999px
Loading ..................

Console