cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <body>
<div class="container text-center">
  <div class="row">
    <h1>Random Quotes Rewritten</h1>
  </div>
  <div class="row">
    <p class="text-600">These are some of my favorite quotes I had collected during medical school I recently rediscovered via the wayback machine. I hope you enjoy them!</p>
  </div>
  <div class="row">
    <button class="btn btn-default btn-lg button-up-shadow">New Quote</button>
  </div>
  <div class="row">
    <div class="rounded-panel text-600">
      <p id="quote-text"></p>
      <p>- <span id="quote-author"></span> -</p>
      <p><a class="twitter-share-button"
 href="https://twitter.com/intent/tweet" data-text="">
      Tweet</a></p>
  </div>
  </div>
<div class="row">
  </div>
</div> <!-- .container -->
  <script>window.twttr = (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0],
    t = window.twttr || {};
  if (d.getElementById(id)) return t;
  js = d.createElement(s);
  js.id = id;
  js.src = "https://platform.twitter.com/widgets.js";
  fjs.parentNode.insertBefore(js, fjs);
 
  t._e = [];
  t.ready = function(f) {
    t._e.push(f);
  };
 
  return t;
}(document, "script", "twitter-wjs"));</script>
</body>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Great+Vibes);
body {
  background-image:  url("https://subtlepatterns.com/patterns/confectionary.png");
  font-family: "Book Antiqua", Palatino, serif;
}
#quote-author {
  font-size: 18px;
}
#quote-text {
  font-size: 20px;
}
h1 {
    font-size: 55px;
    text-shadow: -5px 5px 5px #999;
    font-family: "Great Vibes", "Book Antiqua", Palatino, serif;
}
.row {
  margin-top: 20px;
  margin-bottom: 30px;  
}
.text-600 {
  width: 600px;
  margin: auto;
  text-align: left;
  font-family: "Times New Roman", Tahoma, serif;
  font-size: 20px;
}
button {
  background-color: #aaccaa !important;
  font-size: 27px !important;
  padding-left: 35px !important;
  padding-right: 35px !important;
  font-family: "Great Vibes", "Book Antiqua", Palatino, serif;
}
.button-up-shadow {
  box-shadow: -5px 5px 5px #999;  
}
.rounded-panel {
  background-color: #fcfcfc;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 20px;  
  box-shadow: -10px 10px 10px #999;
}
.rounded-panel p {
    text-align: center;
}




a.twitter-share-button
 {
  display: inline-block;
  padding: 1px 3px 0 19px;
  border: #ccc solid 1px;
  border-radius: 3px;
  background: #f8f8f8 url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgNzIgNzIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwID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4Yy0wLjAwMiwwLjA1NS0wLjAwMiwwLjExLTAuMDAyLDAuMTYyYzAsNi4zNDUsNC41MTMsMTEuNjM4LDEwLjUwNCwxMi44NA0KCWMtMS4xMDEsMC4yOTgtMi4yNTYsMC40NTctMy40NDksMC40NTdjLTAuODQ2LDAtMS42NjctMC4wNzgtMi40NjUtMC4yMzFjMS42NjcsNS4yLDYuNDk5LDguOTg2LDEyLjIzLDkuMDkNCgljLTQuNDgyLDMuNTEyLTEwLjEyOSw1LjYwNi0xNi4yNiw1LjYwNmMtMS4wNTUsMC0yLjA5Ni0wLjA2MS0zLjEyMi0wLjE4NGM1Ljc5NCwzLjcxNywxMi42NzYsNS44ODIsMjAuMDY3LDUuODgyDQoJYzI0LjA4MywwLDM3LjI1MS0xOS45NDksMzcuMjUxLTM3LjI0OWMwLTAuNTY2LTAuMDE0LTEuMTM0LTAuMDM5LTEuNjk0QzY0LjgzOCwyMC4wNjgsNjcuMDU4LDE3Ljc2NSw2OC44MTIsMTUuMTQxeiIvPg0KPC9zdmc+DQo=") 2px 3px no-repeat,
              linear-gradient(#fff, #dedede);
  background-size: 16px 13px, auto auto;
 
  /* Text */
    font: bold 11px/17px Helvetica, Arial, sans-serif;
  text-decoration: none;
  color: #333;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
  white-space: nowrap;
}
 
/* Color Highlight for keyboard navigation */
a.twitter-share-button:focus {
  outline: none;
  border-color: #0089cb;
}
            
          
!
            
              var quotes = [
  { text: 'Keep love in your heart. A life without it is like a sunless garden when the flowers are dead.',
    author: 'Oscar Wilde'
  },
  { text: 'My one regret in life is that I am not someone else.',
    author: 'Woody Allen'
  },
  { text: 'I am not afraid of death, I just don\'t want to be there when it happens.',
    author: 'Woody Allen'
  },
  { text: 'We cannot solve our problems with the same thinking we used when we created them.',
    author: 'Albert Einstein'
  },
  { text: 'The difference between stupidity and genius is that genius has its limits.',
    author: 'Albert Einstein'
  },
  { text: 'Education is what remains after one has forgotten what one has learned in school.',
    author: 'Albert Einstein'
  },
  { text: 'I may be drunk, Miss, but in the morning I will be sober and you will still be ugly.',
    author: 'Winston Churchill'
  },
];

var setQuote = function() {
    var id = Math.floor(Math.random()*quotes.length);
    $("#quote-text").html(quotes[id].text);
    $("#quote-author").html(quotes[id].author);
  $(".twitter-share-button").attr("data-text", quotes[id].text+' -'+quotes[id].author);
}

$(document).ready(function() {
  setQuote();
  
  $('button').click(function() {
    setQuote();
  });
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console