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

Packages

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.

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

              
                <div id="mainContainer">
  <div class="title">
    <h1 class="text-center">Random Quote Generator</h1>
    <p class="text-center">Get your daily inspiration right here!</p>
  
  
  <div id="quote" class="">
    
    <blockquote id="quoteText" class="blockquote"> <p>
      Click on "New Quote" to get a random quote!
      </p>
    <footer id="quoteAuthor" class="text-right">
      Random Quote Generator 
    </footer>
     
    </blockquote>  
    
  </div>
  <p class="text-center share"><a id="share" target="_blank">Tweet this quote!</a> </p>
  <button id="generator" class="btn">New Quote</button>
  
</div>

              
            
!

CSS

              
                #mainContainer {
  background-image: url(http://imgh.us/kTKoLjKEc.jpg);
  display: block;
  height: 100vh;
  background-size: 100% 100%;
  background-position: center;
  margin: 0 auto;
}
.title h1 {
  padding-top: 100px;
  margin-top: 0;
  font-weight: 700 !important;
  font-size: 60px;
  font-family: PT Sans;
}

.title p {
  font-weight: 400;
  font-size: 25px;
  font-family: PT Sans;
}
#quote {
  width: 50%;
  margin: 40px auto;
  background-color: rgba(190,190,190,0.5);
  border-radius: 10px;
}
#quote blockquote p{
  font-family: 'Roboto Slab', serif;
  font-size: 27px;
  font-style: ;
}
#quote footer{
  font-family: 'PT Sans', serif;
  font-size: 23px;
  
}

#generator {
  margin: 0 auto;
  padding-bottom: 30px;
  display: block;
  height: 60px;
  width: 180px;
  font-family: PT Sans;
  font-weight: 700;
  font-size: 30px;
  color: #fff;
  border: 1px solid #708090;
  background-color: DarkSalmon;
  
}
#tweet {
  display: block;
  margin-top: 50px;
  margin-left: 500px;
  position: absolute;
}
.share {
  font-weight: 400;
  font-size: 23px;
  font-family: PT Sans;
  margin-top: -20px;
}
              
            
!

JS

              
                var quotes = [
  {
    quote : "There are no short cuts to any place worth going.",
    author: "Beverly Sills"
  },
  {
    quote: " Life is about making an impact, not making an income.",
    author: "Kevin Kruse"
  },
  {
    quote: "Success is going from failure to failure without losing your enthusiasm.",
    author: "Winston Churchill"
  },
  {
    quote: "The journey of a thousand miles begins with one step.",
    author: "Lao Tzu"
  },
  {
    quote: "What you do speaks so loudly that I cannot hear what you say.",
    author: "Ralph Waldo Emerson"
  },
  {
    quote: "You must be the change you wish to see in the world.",
    author: "Ghandi"
  },
  {
    quote: "Tough times never last, but tough people do.",
    author: "Dr. Robert Schuller"
  },
  {
    quote: "Keep your face to the sunshine and you can never see the shadow.",
    author: "Helen Keller"
  },
  {
    quote: "There is only one success: to be able to spend your life in your own way.",
    author: "Christopher Morley"
  },
  {
    quote: "The best dreams happen when you’re awake.",
    author: "Cherie Gilderbloom"
  },
  {
    quote: "Believe and act as if it were impossible to fail.",
    author: "Charles Kettering"
  },
  {
    quote: "Don’t count the days, make the days count.",
    author: "Muhammad Ali"
  },
  {
    quote: "The difference between ordinary and extraordinary is that little extra.",
    author: "Jimmy Johnson"
  },
  {
    quote: "You must not only aim right, but draw the bow with all your might.",
    author: "Henry Davit Thoreau"
  },
  {
    quote: "Even if you’re on the right track, you’ll get run over if you just sit there.",
    author: "Will Rogers"
  },
  {
    quote: "When you come to a roadblock, take a detour.",
    author: "Mary Kay Ash"
  },
  {
    quote: "Don’t wait. The time will never be just right.",
    author: "Napoleon Hill"
  },
  {
    quote: "A year from now you may wish you had started today.",
    author: "Karen Lamb"
  },
  {
    quote: "It is never too late to be what you might have been.",
    author: "George Eliot"
  },
  {
    quote: "Do what you can, where you are, with what you have.",
    author: "Teddy Roosevelt"
  },
  {
    quote: "What we fear doing most is usually what we most need to do.",
    author: "Tim Ferris"
  },
  {
    quote: "To avoid criticism, do nothing, say nothing, be nothing.",
    author: "Elbert Hubbard"
  },
  {
    quote: "The more I want to get something done, the less I call it work.",
    author: "Richard Bach"
  },
  {
    quote: "Your imagination is your preview of life’s coming attractions.",
    author: "Albert Einstein"
  },
  {
    quote: "Obsessed is just a word the lazy use to describe the dedicated.",
    author: "Russel Warren"
  },

]; 
$(document).ready(function(){
 $("#generator").click(function(){
  var quoteId = Math.floor(Math.random()*26);
  $("#quoteText").html("<p>"+quotes[quoteId].quote+"</p>"+"<footer id=\"quoteAuthor\" class=\"text-right\">"+quotes[quoteId].author+"</footer>");
   $("#share").attr("href",("https://twitter.com/home/?status="+"\""+quotes[quoteId].quote+"\""+" by "+quotes[quoteId].author))
 
 }); 
  
}); 

              
            
!
999px

Console