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


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


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.


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.



  <div class='container-fluid'>
    <div class='col-md-6 col-md-offset-3 text-center'>
      <h1>Random Quotes</h1>
      <p>Click the button below to generate random quotes.</p>
      <hr />
      <div id='the-quote'>
          <span>Oops...I guess we have nothing to say.</span>
          - by this guy. 
      <br />
    <button class='btn btn-default quote'> Next Quote </button>
  <div class='source'>
    Quote Provided By: <a href=''></a>
 <hr />
 <a class='btn btn-default btn-info' href="#">Tweet This!</a>


                .fa-quote-left {
  position: absolute;
  float: left;
  font-size: 5em;
  font-style: italic;
  margin-left: -65%;

  position: absolute;
  float: right;
  font-size: 5em;
  font-style: italic;
  margin-left: 45%;

  padding: 5%;

strong span{
  font-size: 2em;

footer span{
  font-size: 1.5em;

  font-size: 4em;

.btn-info a {
  color: #FFF;



                $(document).ready(function() {
  //Adds first quote to DOM.

  //Grabs quote from API. Sends quote JSON to displayQuote() function. Sends quote JSON to tweetURL function.
  function newQuote() {

        url: "[orderby]=rand&filter[posts_per_page]=1&jsonp=?",
        success: function(quote){
        cache: false

  //Populates the DOM with the quote, author, and link.
  function displayQuote(quote) {
    $('strong span').html(quote[0].content).fadeIn('slow');
    $('footer span').html('- ' + quote[0].title).fadeIn('slow');
    $('.source a').attr('href', quote[0].link).fadeIn('slow');

  //Fades out the previous quote and author.
  function fadeQuote() {
    $('strong span').fadeOut('slow');
    $('footer span').fadeOut('slow');

  //Creates Twitter URL from qoute JSON.
  function tweetURL(quote) {
    var tweetContent = quote[0].content.replace(/(<([^>]+)>)/ig, "");
    var url;

    if (quote[0].content.length >= 140) {
      tweetContent = tweetContent.slice(0, 135) + "(...)";
    } else {
    url = "" + tweetContent;

  //add quote URL to Tweet button
  function addURL(newURL) {
    $('.btn-info').attr('href', newURL);

  //set link window size and functionality
  $('.btn-info').click(function(event) {
    var width = 575,
      height = 400,
      left = ($(window).width() - width) / 2,
      top = ($(window).height() - height) / 2,
      url = this.href,
      opts = 'status=1' +
      ',width=' + width +
      ',height=' + height +
      ',top=' + top +
      ',left=' + left;, 'twitter', opts);
    return false;

  //replace quote on click
  $('.quote').click(function() {