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.



  <title>FCC Random Quote Project</title>

  <div class="wrapall">
    <div class="quotewrap">
      <div class="quote"></div>
      <div class="author"></div>
    <div class="buttonwrap">
      <button id="tweet"><img src=""></button>
      <button id="newquote">Quote Me</button>  



                body {
  padding: 0px;
  margin: 0px; }

  padding: 50px;
  margin: 50px;
  max-width: 500px;
  background-color: #999;
  border-radius: 10px; }

  color: white;
  padding: 0px 0px 25px 0px;
  font-family: fantasy;
  font-size: 15pt;
  max-width: 500px; 
  text-align: center; }

  color: white;
  padding: 0px 0px 50px 0px;
  font-family: fantasy;
  text-align: right;
  max-width: 500px; }

  margin: 1px 0px 0px 0px;
  padding: 1px 0px 0px 0px;
  border-radius: 5px; }

#tweet:hover {
  cursor: pointer; }

  padding: 10px;
  float: right;
  border-radius: 5px; }

#newquote:hover {
  cursor: pointer; }


                $(document).ready(function() {
  var quote, author;
  function getQuote () {
      url: "[orderby]=rand&filter[posts_per_page]=1",
      cache: false,
      success: function(json) {
        //the json has html embedded in it so this is to remove that markup
        var endquote = json[0].content.lastIndexOf("<");
        var quote = json[0].content.slice(3,endquote);
        $(".quote").html("\"" + quote + "\"");
        $(".author").html("-" + json[0].title);
  //$("#newquote").on("click", getQuote());
  $("#newquote").click((e) => getQuote());  
  $("#tweet").on("click", function() {"" + $(".quote").text() + " " + $(".author").text());