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 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

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

              
                <!--
Narrow jumbotron
Build a more custom page by narrowing the default container and jumbotron. 
-->
<div class="container">
      <div class="header">
        <ul class="nav nav-pills pull-right">
          <li class="active"><a href="http://www.openf2.org">Home</a></li>
          <li><a href="http://docs.openf2.org">Docs</a></li>
          <li><a href="https://github.com/OpenF2/F2">GitHub</a></li>
        </ul>
        <h3 class="text-muted">F2 Demo</h3>
      </div>

      <div class="jumbotron">
        <h1>Jumbotron heading</h1>
        <p class="lead">This out-of-the-box Boostrap 3 template has been modified slightly to demonstrate placement of two F2 Apps alongside exsting content. The Apps have <span style="color:red">red</span> outlines to show their location.</p>
        <p><a class="btn btn-lg btn-success" href="http://www.openf2.org" role="button">Go to OpenF2.org</a></p>
      </div>

      <div class="row marketing">
        <div class="col-sm-4">
          <h4>Subheading</h4>
          <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>

          <h4>Subheading</h4>
          <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.</p>

          <h4>Subheading</h4>
          <p>Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
        </div>
        <div class="col-sm-8" id="com_openf2_examples_nodejs_helloworld"></div>
 	 </div>
 	<div class="row marketing">
        <div class="col-lg-6">
          <h4>Subheading</h4>
          <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>

          <h4>Subheading</h4>
          <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.</p>

          <h4>Subheading</h4>
          <p>Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
        </div>
      </div>
  
    <div class="row marketing">
      <div class="col-sm-12">
        <div id="com_openf2_examples_csharp_marketnews">
          <h2 class="page-header">Yahoo! Business Headlines</h2>
        </div>
      </div>
    </div>

      <div class="footer">
        <p>&copy; Markit On Demand, Inc. 2014</p>
      </div>

    </div> <!-- /container -->
              
            
!

CSS

              
                @import "https://maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css";
@import "https://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css";

.f2-app-container {
  outline: 1px dotted red;
  padding: 0 10px 10px 10px;
}

.com_openf2_examples_nodejs_helloworld h1.page-header {
  margin-top: 5px;
}

.com_openf2_examples_csharp_marketnews ul {
  list-style: none;
  padding: 0;
}
              
            
!

JS

              
                $(function(){
  //get AppHandler token
  var _token = F2.AppHandlers.getToken();
  //create & assign a "root" element for the App
  F2.AppHandlers.on(
    _token,
    F2.Constants.AppHandlers.APP_CREATE_ROOT,
    function(appConfig) {
		appConfig.root = document.getElementById(appConfig.appId);
    }
  );
  //render the App
  F2.AppHandlers.on(
    _token,
    F2.Constants.AppHandlers.APP_RENDER,
    function(appConfig, appHtml) {
      $(appConfig.root).append(appHtml);
    }
  );
  //init F2 & register Apps
  F2.init();
  F2.registerApps([
    {
      appId: 'com_openf2_examples_nodejs_helloworld',
      manifestUrl: 'http://www.openf2.org/F2/apps'
    },
    {
      appId: 'com_openf2_examples_csharp_marketnews',
      manifestUrl: 'http://www.openf2.org/F2/apps'
    }
  ]);
});  
              
            
!
999px

Console