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.


<link href="" rel="stylesheet">

<img src="#" id="bg" alt="" class = "img-responsive">

<div class = "container-fluid text-center main-div" >
  <h1>Random Quote Machine</h1>
  <div class="well">
    <span id = "quote"></span>
    <span id = "author"></span>

  <button class = "btn btn-default" id = "new_quote">New Quote</button>
  <button class = "btn btn-default " id="tweet_out">Tweet Out</button>



                #bg {
  position: fixed; 
  top: 0; 
  left: 0;     
  min-width: 100%;
  min-height: 100%;
  z-index: -1;
  z-index: 1;
	margin: 5% auto;
	max-width: 600px;
  font-family: 'Prociono', serif;

#quote {
  font-style: italic;
  font-size: 18px;

h1 {
  margin: 25px;
  color: rgb(26, 29, 30);



                var bg1 = "";
var bg2 = "";
var bg3 = "";
var bg4 = "";
var bg5 =  "";
var bg6 = "";

var qt1 = "There is no greater agony than bearing an untold story inside you." ; 
var qt2 = "Everything you can imagine is real.";
var qt3 = "You can never get a cup of tea large enough or a book long enough to suit me.";
var qt4 = "To the well-organized mind, death is but the next great adventure.";
var qt5 = "Do what you can, with what you have, where you are.";
var qt6 = "Life isn't about finding yourself. Life is about creating yourself.";

var at1 = "Maya Angelou, I Know Why the Caged Bird Sings" ; 
var at2 = "Pablo Picasso";
var at3 = "C.S. Lewis";
var at4 = "J.K. Rowling, Harry Potter and the Sorcerer's Stone ";
var at5 = "Theodore Roosevelt";
var at6 = "George Bernard Shaw";

var bgArray = [bg1, bg2, bg3, bg4, bg5, bg6];
var qtArray = [qt1, qt2, qt3, qt4, qt5, qt6];
var atArray = [at1, at2, at3, at4, at5, at6];

var quoteText;
var quoteAuthor;
function newQuote(){
  var randomBg = Math.floor(Math.random() * bgArray.length);
  var randomQt = Math.floor(Math.random() * qtArray.length);
  $("#bg").attr("src", bgArray[randomBg]);
  $("#quote").text('" ' + qtArray[randomQt] + ' "');
  $("#author").text(" - " + atArray[randomQt]);
  var bgAct = $("#bg").attr("src");
    if( bgAct === bg1 || bgAct === bg2 || bgAct === bg3){
      $("h1").css("color", "white");
    } else {
       $("h1").css("color", "rgb(26, 29, 30)");


$( document ).ready(function() {

$("#new_quote").on("click", function(){


$("#tweet_out").on("click", function(){  
  var tweetQuote = $("#quote").text() + " " + $("#author").text();"" + tweetQuote);