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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

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


  <title>Random Quote Machine</title>



  <section id="random-quote-machine">
    <div class="container d-flex">
      <div class="card">
        <h3 class="card-header text-center bg-info">Random Quote Machine</h3>
        <div class="card-block bg-warning">
          <blockquote class="card-blockquote">
            <p class="quote-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p><hr>
            <footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
        <div class="button-container d-flex mt-2">
          <a class="btn btn-outline-success" href='#' role="button" id="btnNewQuote"><span class="fa fa-quote-left"></span> New Quote <span class="fa fa-quote-right"></span></a>
          <a class="btn btn-outline-info" href='#' target="_blank" role="button" id="btnTweetIt"><span class="fa fa-twitter"></span> Tweet It</a>
          <a class="btn btn-outline-primary" href='#' target="_blank" role="button" id="btnFacebookIt"><span class="fa fa-facebook"></span> Facebook It</a>





                .container {
  //display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
.button-container {
  //display: flex;
  justify-content: space-between;

.card {
  background: white;
  width: 500px;
  height: initial;
  padding: 40px;
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5);
  z-index: 1;
  transform: rotate(3);

.blockquote-footer {
  font-size: 16px;
  text-align: right;


                $(document).ready(function() {
  window.fbAsyncInit = function() {
      appId: '1875238189415848',
      cookie: true,
      xfbml: true,
      version: 'v2.8'

  (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {
    js = d.createElement(s); = id;
    js.src = "//";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));
    var quoteAuthorText;
    var tweetUrl = 'https://\';
    $("#btnNewQuote").on('click', function(){
    $("#btnTweetIt").on('click', function(){
    $("#btnFacebookIt").on('click', function(){

function getNewQuote() {

    /* Get random quote via JSONP */
    var apiURL = ""
    $.getJSON(apiURL, function(data) {

      var quote = data.quoteText.trim();
      var author = (data.quoteAuthor.trim() || 'Anonymous');
      quoteAuthorText = quote + ' - ' + author;
      tweetURL = 'https://\' + quoteAuthorText;
      /* Attach quote in div quote class with fade-in */



  /* Create attribute for anchor Twitter button - open new window to tweet the quote */ 
function tweetIt(){
      $('#btnTweetIt').attr('href', tweetURL);

function facebookIt(){
     FB.login(function() {
       //quoteAuthorText = $(quoteAuthorText).text();
            FB.api('/me/feed', 'post', {
            message: quoteAuthorText
        }, {
          scope: 'publish_actions'