Pen Settings



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


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


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.


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.


                <div id="title" class="well text-center">
  <h1>Computer Science Quotes</h1>
<div id="quote-box" class="well text-center">
  <h2 id="quote">Some cool quote.</h2>
  <h3 id="author" class="">&#8213; Cool guy</h3>
  <div id="buttons"><button id="quote-button" class="btn">Show me another!</button>
    <button class="btn btn-primary"><a id="tweet-button" target="_blank" href="" class="twitter-share-button">Tweet <i class="fa fa-twitter"></i></a></button></div>


                body {
  transition: background-color 3s;

#title {
  margin: 0 auto;
  margin-top: 5em;
  margin-bottom: 1em;
  max-width: 50%;
  font-family: 'Orbitron', sans-serif;
  background: rgba(245, 245, 245, .7);

#quote-box {
  background: #000;
  background: linear-gradient(170deg, #000, #404040);
  border-color: #404040;
  color: #AAAAAA;
  margin: 0 auto;
  margin-top: 1em;
  max-width: 50%;
  min-height: 40%;
  font-family: 'Space Mono', monospace;

#author {

#buttons {
  color: black;

#tweet-button {
  color: #FFF;


                function updateTweetButton() {
  $('#tweet-button').attr('href', '' + $('#quote').text() + '&url=');

function generateColor() {
  var color = 'rgb(';
  // Going to 180 seems to make it less likely to get dark colors that make text hard to read
  var r = Math.ceil(Math.random() * 180);
  var g = Math.ceil(Math.random() * 180);
  var b = Math.ceil(Math.random() * 180);
  color = color + r + ',' + g + ',' + b + ')';
  return color;

function generateQuote() {
  var lastQuote = $('#quote').text();
  $.getJSON("", function(json) {
    $("#author").html('&#8213; ' +;

$(document).ready(function() {
  $('#quote-button').on('click', function() {

    $('body').css('background-color', generateColor());

  }); // OnClick

}); // Doc ready