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

              
                <head>
    <title>Random Quote Generator</title>
  </head>
<link href="https://fonts.googleapis.com/css?family=Cutive+Mono|Quicksand|Roboto:300|Days+One|Merriweather:900|Shrikhand" rel="stylesheet">
  
  <body>
    <script src="https://use.fontawesome.com/9602927839.js"></script>
    
    <div class="container text-center">
      
      <div class="col-xs-12">
        <div id="quotebox">
          <div id="quoteheader"><h1><i class="fa fa-free-code-camp" aria-hidden="true"></i></h1></div>
          <div id="quotetainer">
        
        <!--Quotes will be displayed here-->
            <p id="quotep">The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.</p>
            <div id="author"><p id="authorp">Robert Frost</p></div>
          </div>    
          <div id="share">
            <p style="float: left;"><button class="btn btn-primary" id="new-quote">New Quote</button></p>
          
          
            <p style="float: right;"><a class="twitter-share-button" href="https://twitter.com/intent/tweet" data-size="large" target="_blank" alt="Tweet This!"><i class="fa fa-twitter" alt="Tweet This!" aria-hidden="true" style="font-size: 250%;" id="tweet-btn"></i></a> 
          
        </div>
        </div>
        <div class="footer">Footer goes here</div>
      
      </div>
    </div>
  </body>
</html>
              
            
!

CSS

              
                body {
  background-color: #000;
  color: #fff;
  background-image: url(http://sperrye.000webhostapp.com/forest.jpg);
  background-size: cover;
}
.container {
  background-color: #fff;
  width: 50%;
  margin-top: 100px;
  border-radius: 30px;
}
.col-xs-12 {
}
#quotebox {
  background-color: #fff;
  color: #000;
}
#quoteheader {
  backgroud-color: grey;
  color: #95b789;
}
#quotetainer {
  background-color: #fff;
  color: #000;
  font-family: 'Shrikhand', serif;
  font-size: 200%;
}
#author {
  font-family: 'Cutive Mono', serif;
  font-size: 40%;
  color: #95b789;
}
#getnew {
  
}
#share {
  font-size: 100%;
  color: #efeaac;
}
#share a:link,
a:visited {
  color: #efeaac;
}
#share a:hover{
  color: #9b2828;
}
#share a:active {
  color: yellow;
}
.btn {
  background-color: #234a4c;
  font-family: 'Quicksand', monospace;
  font-size: 90%;
  text-transform: lowercase;
  color: #fff;
  border-width: 0px;
}
.btn-primary:hover {
  background-color: #95b789;
}
.btn-primary:focus, btn-primary:active, btn-primary.active {
  background-color: #9b2828;
}
.btn:active, btn:focus, btn.active, btn.focus {
  background-color: #9b2828;
}
              
            
!

JS

              
                var quotes = [{
  quote: 'On earth there is no heaven, but there are pieces of it.',
  author: 'Jules Renard'
},{
    quote: 'The clearest way into the Universe is through a forest wilderness.',
    author: 'John Muir'
},{
    quote: 'There is pleasure in the pathless woods, there is rapture in the lonely shore, there is society where none intrudes, by the deep sea, and music in it\'s roar; I love not Man the less, but Nature more.',
    author: 'Lord Byron'
}];


$(document).ready(function() {
  $('#new-quote').click(function() {
    var quotesLength = quotes.length;
    var randomNumber = Math.floor(Math.random()*quotesLength);
    $("#quotep").text(quotes[randomNumber].quote);
    $("#authorp").text(quotes[randomNumber].author);
                      });
  $('#tweet-btn').click(function() {
    window.open('https://twitter.com/intent/tweet?text=' + $('#quotep').text() + " " + $("#authorp").text());
  });
  });
              
            
!
999px

Console