Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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

                <div class="container-fluid top">
      <div class="col-md-12 col-sm-12 text-center">
        <h1 id="title">Random Quote</h1>

    <div class="jumbotron container-fluid row-centered random-quote">
      <div class="quote-section text-center col-md-12">
          <p id="quote" class="col-md-12 col-sm-12">"Quote"</p>
        <p id="author" class="col-md-12 col-sm-12">Author</p>

      <div class="tweet col-md-6 col-xs-6">
        <button class="btn btn-primary" id="twitter">
          <span class="fa fa-twitter"></span>

      <div class="col-md-6 col-xs-6">
        <button type="button" name="New Quote" class="btn btn-info" id="gen"><span>New Quote</span></button>
      <div class="col-md-12 col-md-13 text-center">
        <p class="long-tweet"></p>

              .top h1 {
  font-size: 3.5em;
  font-family: 'Montserrat', sans-serif;

.random-quote {
  margin-top: 3em;

.tweet {
  display: flex;
  justify-content: flex-end;

#quote {
  font-family: 'PT Sans', sans-serif;

#author {
  font-family: "Arimo", sans-serif;

.long-tweet {
  padding-top: 40px;
  font-family: 'Montserrat',sans-serif;

              var url = "https://api.forismatic.com/api/1.0/?method=getQuote&key=random&format=jsonp&lang=en&jsonp=?";
$(document).ready(function() {
  $("#gen").on("click",function() {
    $.getJSON(url, function(val) {
      var quotes = [];
      if(quotes[1] === '""'){
        quotes[1] = '"Unknown"';
      var quote = quotes[0].replace(/;/g, "");
      var author = quotes[1].replace(/"/g, "");
      if(quote.length + author.length > 140) {
          $(".long-tweet").text("This quote is too long to be tweeted");
          $("#twitter").attr('class', 'btn btn-danger disabled');
      }else {
        $("#twitter").attr('class', 'btn btn-primary');
      var quot = 'https://twitter.com/intent/tweet?text=' + quote + ' ' + author;

      $("#twitter").unbind().on('click', function() {
        window.open(quot, 'twitter');

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.