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="color-container container text-center">
  <div class="row">
    <div class="col-xs-12">
      <div class="random-quote">
        <header>
          <h2 style="color: #555;"><b><u>Random Quotes</u></b></h2>
        </header>
        <blockquote>
          <h3 id="quote"></h3>
          <footer>
            <cite id="sayer"></cite>
          </footer>
        </blockquote>
        <footer>
          <a id="tweetbutton" class="btn btn-primary">Tweet This Quote</a>
          <button id="random" class="btn btn-success">Get a Quote</button>
        </footer>
      </div>
    </div>
  </div>
</div>
</div>
              
            
!

CSS

              
                body {
  background-color: blue;
}


.random-quote {
  border-radius: 5px;
  background-color: white;
  height: 300px;
  width: 600px;
  margin-top: 100px;
  margin-left: auto;
  margin-right: auto;
  border-style: solid;
  border-width: 3px;
}


h3 {
  font-family: serif;
}

h3:before {
  font-famaly: serif;
  content: open-quote;
  font-weight: bold;
  font-size: 50px;
  color: #889c0b;
}
              
            
!

JS

              
                
var arr = [
  ["Whatever the mind of man can conceive and believe, it can achieve.", "Napoleon Hill"],
  ["Life is what happens to you while you’re busy making other plans.", "John Lennon"],
  ["We become what we think about.", "Earl Nightingale"],
  ["Life is 10% what happens to me and 90% of how I react to it.", "Charles Swindoll"],
  ["The most common way people give up their power is by thinking they don’t h  ave any.", "Alice Walker"],
  ["The best time to plant a tree was 20 years ago. The second best time is now.", "Chinese Proverb"],
  ["Winning isn’t everything, but wanting to win is.", "Vince Lombardi"],
  ["You can never cross the ocean until you have the courage to lose sight of the shore.", "Christopher Columbus"],
  ["The two most important days in your life are the day you are born and the day you find out why.", "Mark Twain"],
  ["People often say that motivation doesn’t last. Well, neither does bathing.  That’s why we recommend it daily.", "Zig Ziglar"],
  ["Two roads diverged in a wood, and I—I took the one less traveled by, And that has made all the difference.", "Robert Frost"],
  ["You miss 100% of the shots you don’t take.", "Wayne Gretzky"],
  ["Every strike brings me closer to the next home run.", "Babe Ruth"]
];

function randomize() {
  var randomQuote = arr[Math.floor(Math.random() * arr.length)];
  return randomQuote;
}
var quote = randomize();

function getSelectionText() {
  return "\"" + quote[0] + " -" + quote[1];
}
$(document).ready(function() {
  $("#tweetbutton").attr("href", 'https://twitter.com/intent/tweet?text=' + encodeURI(getSelectionText()) + '&url=' + encodeURI(document.URL));
  $("#tweetbutton").attr("target", '_blank');

  $("#quote").html(quote[0]);
  $("#sayer").html(quote[1]);

  $("#random").click(function() {
    var quote = randomize();
    $("#quote").html(quote[0]);
    $("#sayer").html(quote[1]);
    $("#tweetbutton").attr("href", 'https://twitter.com/intent/tweet?text=' + encodeURI(getSelectionText()) + '&url=' + encodeURI(document.URL));
    $("#tweetbutton").attr("target", '_blank');
  });
});
              
            
!
999px

Console