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 is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                  <body class="background">
    <div class="main-box-color" id="main-box">
      <h1> Random Quote Machine </h1>
      <!-- Quotes from API will be here! -->
      <h3 id="quote-title"></h3>
      <p id="quote-content"></p>
      <p id="quote-source"></p>
        <div class="button-container">
      <button id="quotes">Get Quotes</button>
    <div id="additional-information">
      <h3> Thank you for trying out my quote machine! In order to use these quotes, please follow the following links:</h3>
      <li><a class="black" id="tweet-quote" href=#>Tweet this!</a><i class="fa fa-twitter" aria-hidden="true"></i></li>
      <!-- <li> Post this on Facebook! <i class="fa fa-facebook" aria-hidden="true"></i></li> -->



                .background {
  background-color: silver;
.background-red {
  transition: all 0.5s ease;
  background-color: #cc1010;
}.background-blue {
  transition: all 0.5s ease;
  background-color: #1328c5;
h1 { 
  text-align: center;
  font-family: Lobster, Ariel, serif;
#main-box {
  position: relative;
  background-color: white;
  width: 50%;
  left: 25%;
  right: 25%;
  margin-top: 50px;
  margin-bottom: 50px;
  border-radius: .5em;
  border-style: solid;
  border-color: black;
  height: 250px;
  overflow: hidden;
.main-box-color {
  color: silver;
.main-box-color-blue {
  transition: all 0.5s ease;
  color: #1328c5;
.main-box-color-red {
  transition: all 0.5s ease;
  color: #cc1010;
#quote-title {
  padding-left: 10px;
#quote-content {
  padding-left: 30px;
  padding-right: 140px;
  font-family: Lobster;
#quote-source {
  padding-left: 10px;
.given-quote {
  text-align: center;
  font-size: 1.2em;
  font-family: Lobster;
.button-container {
  position: absolute;
  bottom: 10px;
  right: 30px;
#quotes {
  border-radius: 0.5em;
  padding: 10px;
#quotes:hover {
  opacity: 0.7;
.fire {
  border-color: yellow;
  background: linear-gradient(to bottom right, red, yellow);
.water {
  border-color: cyan;
  background: linear-gradient(to bottom right, blue, cyan);
#additional-information {
  text-align: center;
  display: inline-box;
.black {
  text-decoration: none;
  color: black;


                var content = "";
$(document).ready(function() {
  $("button").on("click", function(e) {
    if ($(this).hasClass("fire")) {
      if ($("body").hasClass("background")) {
      } else {
    } else {
    // Quote Generator
    //$('button').on('click', function(e) {
      success: function(data) {
        var post = data.shift(); // The data is an array of posts. Grab the first one.
        //implementing into twitter.
        content = $("#quote-content").text();
          .attr("href", "" + content)
          .attr("target", "_blank");
        // If the Source is available, use it. Otherwise hide it.
        if (
          typeof post.custom_meta !== "undefined" &&
          typeof post.custom_meta.Source !== "undefined"
        ) {
          $("#quote-source").html("Source:" + post.custom_meta.Source);
        } else {
        // Animating the box
        var el = $("#main-box");
        curHeight = el.height();
        autoHeight = el.css("height", "auto").height();
        el.height(curHeight).animate({ height: autoHeight }, 500);
      cache: false

/*$.getJSON("[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
  $(".given-quote").append(a[0].content + "<p>— " + a[0].title + "</p>")