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

              
                <div class="container-fluid">
  <body>
    <!--heading row-->
    <div class="row">
      <!--left empty column-->
      <div class="col-md-2">
      </div>
      <!--center heading column-->
      <div class="col-md-8">
        <h1 class="text-primary" id="heading">Random Quote Generator</h1>
      </div>
      <!--right empty column-->
      <div class="col-md-2">
      </div>
    <!--end heading row-->
    </div>
    
    <!--buttons row-->
    <div class="row">
      <!--left empty col-->
      <div class="col-md-4">
      </div>
      <!--twitter button-->
      <div class="col-md-2">
        <button class="btn btn-block btn-primary">Tweet!</button>
      </div>
      <!--next quote button-->
      <div class="col-md-2">
        <button class="btn btn-block btn-primary" id="getMessage">Generate!</button>
      </div>
      <!--right empty col-->
      <div class="col-md-4">
      </div>
    <!--end buttons row-->
    </div>
    <!--quote-well row-->
    <div class="row">
      <!--left empty column-->
      <div class="col-md-2">
      </div>
      <!--center well-->
      <div class="col-md-8">
        <div class="well">
          <h2 class="message text-center">Click Generate!</h2>
          <h2 id="author"></h2>
        </div>
      </div>
      <!--right empty column-->
      <div class="col-md-2">
      </div>
    <!--end quote-well row-->
    </div>
      
    
    
  </body>
  
  
  
  
  
  
</div>
              
            
!

CSS

              
                body{
  background-color: lightblue;
  margin-top: 100px;
}

#heading{
  color: black;
  text-align: center;
}

.btn{
  margin-bottom: 15px;
}

h1{
  font-size: 30px;
}
h2{
  font-size: 25px;
}
              
            
!

JS

              
                $(document).ready(function() {
$('#getMessage').on('click', function(e) {
    e.preventDefault();
    $.ajax( {
      url: "https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1", 
      success: function(stuff) {
        var post = stuff.shift();
        //console.log(data);// The data is an array of posts. Grab the first one.
        $('#author').text("- " + post.title);
        $('.message').html(post.content);

        // If the Source is available, use it. Otherwise hide it.
        

/*        if (typeof post.custom_meta !== 'undefined' && typeof post.custom_meta.Source !== 'undefined') {
 *        $('#quote-source').html('Source:' + post.custom_meta.Source);
 *       } else {
 *         $('#quote-source').text('');
 *       }
 */ 
      },
      cache: false
    });
  });
});
              
            
!
999px

Console