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 class="container-fluid">
  <div id="quote-box">
    <div class = "row">
      <div class = "col-xs-12 col-md-offset-4 col-sm-6 col-md-offset-4 col-md-4  col-lg-offset-4 col-lg-4 box">
        <div class = "row">
          <div id="quote" class="col-xs-12 col-md-12 col-lg-12">"<div id="replacequote"></div> </div>
          <div id="author" class="col-xs-12 col-md-offset-4 col-md-6  col-lg-offset-4 col-lg-6"><div id="replaceauth"></div></div>
        </div>
        <div class = "col-xs-6 col-sm-6 col-md-offset-1 col-md-2  col-lg-offset-1 col-lg-2"><a class="btn" id="tweet-quote" title="Tweet this quote!" target="_blank">
         <i class="fa fa-twitter font-aws" aria-hidden="true"></i>
        </a></div>
        <div class = "col-xs-6 col-sm-6 col-md-offset-5 col-md-4 col-lg-offset-5 col-lg-4">
          <button id = "getMessage" class = "btn btn-green">
            Generate
          </button>
        </div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body{
  background:#8a8a5c;
}
#quote-box{
  margin: 40px 0px 40px 0px;
}
.box{
  background-color:#FFF;
  border-radius: 5%;
  min-height:320px;
  max-height:500px;
}
h4
{
  color:#6600cc;
  font-family: 'Cinzel', serif;
  font-size: 35px;
}
#quote{
  margin: 10px 0px 0px 0px;
  color:#6600cc;
  font-family: 'Cinzel', serif;
  font-size: 25px;
}
#author{
  color:#6600cc;
  font-family: 'Tangerine', serif;
  font-size: 30px;
  height 30px;
}
.btn-green{
  background-color: #8a8a5c;
  color:#FFF;
  font-family: 'Tangerine', serif;
  font-size: 30px;
  margin: 0px 0px 20px 0px;
}
#tweet-quote{
  float: left;
  padding: 0px;
  padding-top: 4px;
  text-align: center;
  font-size: 1.2em;
  margin-right: 5px;
  height: 30px;
  width: 40px;
  background-color: #8a8a5c;
}
.font-aws
{
  color:#FFF;
}
              
            
!

JS

              
                function getRandom(){
    var myQuotes = [{
          quote: "I know where I'm going and I know the truth, and I don't have to be what you want me to be. I'm free to be what I want." ,
          author: "Muhammad Ali",
      }, {
          quote: "Good, better, best. Never let it rest. 'Til your good is better and your better is best.",
          author: "St. Jerome",
      }, {
          quote: "However difficult life may seem, there is always something you can do and succeed at.",
          author: "Stephen Hawking",
      }, {
          quote: "If your actions inspire others to dream more, learn more, do more and become more, you are a leader.",
          author: "John Quincy Adams",
      }, {
          quote: "I am not afraid of an army of lions led by a sheep; I am afraid of an army of sheep led by a lion.",
          author: "Alexander the Great",
      }, {
          quote: "There is no substitute for hard work.",
          author: "Thomas A. Edison",
      }, {
          quote: "The best preparation for good work tomorrow is to do good work today.",
          author: "Elbert Hubbard",
      }, {
          quote: "The truth is you don't know what is going to happen tomorrow. Life is a crazy ride, and nothing is guaranteed.",
          author: "Eminem",
      }, {
          quote: "Yesterday is not ours to recover, but tomorrow is ours to win or lose.",
          author: "Lyndon B. Johnson",
      }, {
          quote: "I'd rather attempt to do something great and fail than to attempt to do nothing and succeed.",
          author: "Robert H. Schuller",
      }];
      var randomQuote = Math.floor(Math.random() * myQuotes.length);
      $('#replacequote').text(myQuotes[randomQuote].quote); 
      $('#replaceauth').text(myQuotes[randomQuote].author);
  }
$(document).ready(function(){
  $("#getMessage").on("click", function() {
      getRandom();
  });
  $("#tweet-quote").on('click',function(){
    var quote = $('#replacequote').html();
    var author = $('#replaceauth').html();
    var tweet = 'https://twitter.com/intent/tweet?text=' + quote + ' - ' + author;
    $('#tweet-quote').attr('href', tweet);
  });
  getRandom();
});
              
            
!
999px

Console