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

              
                <html>
<head>
  <link href="https://fonts.googleapis.com/css?family=Lobster|Raleway" rel="stylesheet">
</head>

<body>
  <div class="container-fluid">
    <img src="https://dncache-mauganscorp.netdna-ssl.com/cropped-wallpapers/1986/1986324-1440x900-[DesktopNexus.com].jpg?st=Ibx2KqMz_9N0p4_WDmJndQ&e=1477032074" /><!--background image-->

    <div class="quoteBlock">
      <h1><div id="quoteGenerator"></div></h1>
      <button id="twitter"><a id="tweet" href="#" target="_blank">
        <svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.1"
   id="svg3626"
   viewBox="0 0 300.00006 224.18703"
   height="26"
   width="30">
  <defs
     id="defs3628" />
  <metadata
     id="metadata3631">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     transform="translate(-539.17946,-568.85777)"
     id="layer1">
    <path
       id="path3611"
       style="fill:#1da1f2;fill-opacity:1;fill-rule:nonzero;stroke:none"
       d="m 633.89823,812.04479 c 112.46038,0 173.95627,-93.16765 173.95627,-173.95625 0,-2.64628 -0.0539,-5.28062 -0.1726,-7.90305 11.93799,-8.63016 22.31446,-19.39999 30.49762,-31.65984 -10.95459,4.86937 -22.74358,8.14741 -35.11071,9.62551 12.62341,-7.56929 22.31446,-19.54304 26.88583,-33.81739 -11.81284,7.00307 -24.89517,12.09297 -38.82383,14.84055 -11.15723,-11.88436 -27.04079,-19.31655 -44.62892,-19.31655 -33.76374,0 -61.14426,27.38052 -61.14426,61.13233 0,4.79784 0.5364,9.46458 1.58538,13.94057 -50.81546,-2.55686 -95.87353,-26.88582 -126.02546,-63.87991 -5.25082,9.03545 -8.27852,19.53111 -8.27852,30.73006 0,21.21186 10.79366,39.93837 27.20766,50.89296 -10.03077,-0.30992 -19.45363,-3.06348 -27.69044,-7.64676 -0.009,0.25652 -0.009,0.50661 -0.009,0.78077 0,29.60957 21.07478,54.3319 49.0513,59.93435 -5.13757,1.40062 -10.54335,2.15158 -16.12196,2.15158 -3.93364,0 -7.76596,-0.38716 -11.49099,-1.1026 7.78383,24.2932 30.35457,41.97073 57.11525,42.46543 -20.92578,16.40207 -47.28712,26.17062 -75.93712,26.17062 -4.92898,0 -9.79834,-0.28036 -14.58427,-0.84634 27.05868,17.34379 59.18936,27.46396 93.72193,27.46396" />
  </g>
</svg><!--twitter svg image-->
        </a>
      </button><!--tweet-->
    </div><!--quote block-->
      

    <div class="row">
      <button id="getQuote">Inspire Me</button>
    </div><!--row-->
  </div><!--container-->
  
  <footer class="footer navbar-fixed-bottom">Quotes courtesy of:<a href="https://forismatic.com/en/" title="Powered by quotes from forismatic.com" style="color: rgb(108, 93, 185); margin-left: 4px; vertical-align: middle;">forismatic.com</a></footer>
  
</body>
</html>
              
            
!

CSS

              
                body {
  font-family: 'Raleway', sans-serif;
  text-align: center;
  margin-bottom: 80px; /* clear top of footer */
}

footer {
  background-color: rgba(255,255,255,0.9);
  font-size: 0.9em;
  padding: 7px;
  opacity: 0.7;
}

cite {
  font-family: 'Raleway', sans-serif;
  font-size: 0.5em;
}

/* transparent background image */
div img { 
  position: fixed;
  left: 0;
  top: 0;
  
  /* fill background */
  min-height: 100%;
  min-width: 1066px;
  
  /* proportional scaling */
  width: 100%;
  height: auto;
  
  opacity: 0.6;
  z-index: -1;
}

/* center image on small screen */
@media screen and (max-width: 1066px) { /*specific to image size */
  div img {
    left: 50%;
    margin-left: -533px;   /* 50% */
  }
}

/* change quoteblock width on large screen */
@media screen and (max-width: 500px) {
  .quoteBlock {
    font-family: 'Lobster', cursive;
    width: 100%;
    margin-top: 100px;
    margin-bottom: 30px;
    padding: 20px 10px;
    background-color: rgba(255,255,255,0.8);
    border-radius: 10px;
  }
}

/* change quoteblock width on small screen */
@media screen and (min-width: 501px) {
  .quoteBlock {
    font-family: 'Lobster', cursive;
    margin-left: 50px;
    margin-right: 50px;
    margin-top: 100px;
    margin-bottom: 30px;
    padding: 50px 50px;
    background-color: rgba(255,255,255,0.8);
    border-radius: 10px;
  }
}

/* inspire me button */
#getQuote {
  color: rgba(255,255,255,1);
  border-color:rgba(207, 191, 252,1);
  border-width:2px;
  border-radius: 5px;
  background-color: rgba(98, 67, 183, 1);
  padding: 20px;
  margin: 5px;
}

/* twitter button */
#twitter {
  margin-top: 30px;
  border: 0px;
  padding-top: 5px;
  border-radius: 5px;
  background-color: rgba(255,255,255,1);
}
              
            
!

JS

              
                $(document).ready(function(){
  
  function generateQuote(){
      $.ajax({
        url:"https://api.forismatic.com/api/1.0/",
        dataType: "jsonp",
        jsonp: "jsonp",
        data: {
          method:"getQuote",
          format:"jsonp",
          lang:"en",
        }
      }).done(function(json) {
        
           /* generate quote on inspire me click */
          $("#quoteGenerator").html("&quot;" + json.quoteText.trim() + "&quot;" + "<br><cite>&dash; " + json.quoteAuthor + "</cite>");

           /* tweet quote on twitter click */
          $("#tweet").attr("href", "https://twitter.com/intent/tweet?hashtags=inspirationalquotes&text=" + "\"" + json.quoteText + "\"" + " -" + json.quoteAuthor);
          });
    
  };

  /* execute quote generation on page load */
  $(function(){
    generateQuote();
  });

  /* generate new quote on button click */
  $("#getQuote").on("click", function(){
    generateQuote();
  });
  
});

              
            
!
999px

Console