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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <html>
<head>
  <link href="https://fonts.googleapis.com/css?family=Josefin+Slab" rel="stylesheet"> 
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
</head>

<!-- Initial Page -->
<body class="background text-center">
  <div class="container-fluid box">
   <div class="row">
     <div class="col-md-12">
    <span id="quote">  </span>
    <span id="author"> </span>
     </div>
      
      <!-- Buttons -->
    <div class= "buttons">
      
         <button id="getMessage" role="button" class="newQuoteButton"><b> New Quote</b></button>
      
          
            <button id="tweet" class= "fa fa-twitter fa-3x twitterButton" title="Tweet this!"> </button> 
          
       </div>  
    </div>
    </div>
    
    
</body>
</html>
              
            
!

CSS

              
                .background{
  background: linear-gradient( rgba(0,0,0,0.6) 100%, rgba(0,0,0,0.6)100%), url(http://i65.tinypic.com/a0w3.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover; 
}

.box {
  background: linear-gradient( rgba(0,0,0,0.6) 100%, rgba(0,0,0,0.6)100%) no-repeat center center fixed;
  border: 2.5px solid black;
  border-radius: 10px;
  margin-top: 150px;
  width: 50%;
}

.newQuoteButton {
  background-color: transparent;
  font-size: 15px;
  color: white;
  border: solid;
  border-color: white;
  border-radius: 5px;
  border-width: 1px;
  padding: 5px 5%;
  margin-bottom: 30px;
  float: right;
  
  }

.newQuoteButton:hover {
  opacity: 0.9;
  color: black;
}

#quote {
  color: white;
  font-size: 50px;
  padding: 50px 10% 0 5%;
  font-family: 'Josefin Slab', serif; 
  white-space: prewrap; 
  display: flex;
  text-aligh: right;
  
}

#author {
  font-style: Arial;
  color: white;
  font-size: 18px;
  white-space: nowrap;
  margin-left: 50%;

}

.twitterButton {
  padding-left: 5%;
  margin-bottom: 25px;
  background-color: transparent;
  color:RGB(85, 172, 238);
  border:none;
	cursor:pointer;
	text-shadow: 2px 4px 3px rgba(0,0,0,0.3);
}

#tweet {
	cursor:pointer;
	text-shadow: 2px 4px 3px rgba(0,0,0,0.3);
}





              
            
!

JS

              
                var quotes = [
  {"author": "Frederick (II) the Great", "quote": "I begin by taking. I shall find scholars later to demonstrate my perfect right."},
  {"author": "Sir Winston Churchill", "quote": "A lie gets halfway around the world before the truth has a chance to get its pants on."},
  {"author": "Sherlock Holmes", "quote": "Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth."},
  {"author": "George Washington Carver", "quote": "When you do the common things in life in an uncommon way, you will command the attention of the world."},
  {"author": "Caddyshak", "quote": "Cinderella story. Outta nowhere. A former greenskeeper, now, about to become the Masters champion. It looks like a mirac...It's in the hole! It's in the hole! It's in the hole!"},
  {"author": "James Branch Campbell", "quote": "The optimist proclaims that we live in the best of all possible worlds, and the pessimist fears this is true."},
  {"author": "Thomas Henry Huxley", "quote": "Try to learn something about everything and everything about something."},
  {"author": "Paul Erdos", "quote": "Problems worthy of attack prove their worth by fighting back."},
  {"author": "In The Heat of the Night", "quote": "They call me Mister Tibbs!"},
  {"author": "Richard Dawkins", "quote": "We are all atheists about most of the gods humanity has ever believed in. Some of us just go one god further."},
  {"author": "The Wizard of Oz", "quote": "I'll get you, my pretty, and your little dog, too!"}
];
  
  $("#author").text(' - ' + quotes[0].author);
  $("#quote").text(' " ' + quotes[0].quote + ' " ');

$(function(){
$("#getMessage").on('click', function(){
  
  var i = Math.floor((Math.random() * 11) + 1); 
  $("#author").text("-" + quotes[i].author);
  $("#quote").text(' " ' + quotes[i].quote + ' " ');
});
  
$("#tweet").on("click", function() { window.open("https://twitter.com/home/?status=" + $("#quote").text() + " " + $("#author").text()); });
});               








              
            
!
999px

Console