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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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="box">
  <h1>H.H The Dalai Lama's Quotes</h1>
  <blockquote> "The purpose of our lives is to be happy." </blockquote>
  <button id = "nextQuote" type="button" class="btn btn-primary"> Next Quote please </button>
<a href="https://twitter.com/intent/tweet?text=the%20purpose%20of%20our%20lives%20is%20to%20be%20happy" target="_blank" id="tw-an" class="pull-right">Tweet this quote</a>



</div>

              
            
!

CSS

              
                body {background-color:blue;}
#box {margin: 20px auto 20px auto; padding: 20px 20px 20px 20px; max-width:600px; background-color: white;}
blockquote {font-size:1.5em;}

              
            
!

JS

              
                /*window.twttr = (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0],
    t = window.twttr || {};
  if (d.getElementById(id)) return t;
  js = d.createElement(s);
  js.id = id;
  js.src = "https://platform.twitter.com/widgets.js";
  fjs.parentNode.insertBefore(js, fjs);

  t._e = [];
  t.ready = function(f) {
    t._e.push(f);
  };

  return t;
}(document, "script", "twitter-wjs"));
*/
var colors=["yellow", "green", "red", "purple", "pink", "gray", "blue" ];
var quotes = ['Be kind whenever possible. It is always possible.','Happiness is not something ready made. It comes from your own actions.', 'This is my simple religion. There is no need for temples; no need for complicated philosophy. Our own brain, our own heart is our temple; the philosophy is kindness.', 'Our prime purpose in this life is to help others. And if you can\'t help them, at least don\'t hurt them.', 'Remember that sometimes not getting what you want is a wonderful stroke of luck.', 'If you want others to be happy, practice compassion. If you want to be happy, practice compassion.', 'In the practice of tolerance, one\'s enemy is the best teacher.', 'My religion is very simple. My religion is kindness.', 'We can never obtain peace in the outer world until we make peace with ourselves.', 'The purpose of our lives is to be happy.'];
$(document).ready(function() {
    $("#nextQuote").on("click", function(){
      var quote = quotes[Math.floor(Math.random()*quotes.length)];   
      $("blockquote").html(quote);
      var url = "https://twitter.com/intent/tweet?text="
      var urlQ = quote.replace(" ", "%20");
      url += urlQ;

      $("body").css("background-color", colors[Math.floor(Math.random()*colors.length)]);
  $("#tw-an").attr("href", url)      

    });
  });
              
            
!
999px

Console