cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="wrapper mx-auto d-block" style="width:700px;">
  <div class="header">
    <h1 style="text-align:center;font:48px amatic sc;margin:60px 0 40px;">A Quote a Day</h1>
    <p style="margin:0 0 60px;">Here is a random quote generator that I made as part of my Front-end Development Certificate from Free Code Camp.</p>
  </div>
  <div class="quote-box mx-auto d-block" style="min-height:200px; width:400px; border:solid black; margin:60px 0 40px;border-radius:18px;background:#F5F5F5;">
	  <div class="quote"></div>
    <div class="mx-auto d-block footer" style="height:50px;width:77px;margin:80px 0 40px;">
      <a class="share-button mx-auto d-block btn btn-primary" target="_blank" href="">Tweet</a>
    </div>
  </div>
  <button class="quote-button btn btn-primary mx-auto d-block" style="margin: 0 0 40px;position:absolute 0px">Next quote!</button>
  <p class="mx-auto d-block" style="width:425px;">Care to see what else I'm learning? <a href="https://www.freecodecamp.com/briannaeason" target="_blank">Here's my fCC profile.</a></p>
</div>
            
          
!
            
              body {
  background:#ADEAEA;
  font:18px amatic sc;
}

.quote {
	font:24px pacifico;
	text-align:center;
	padding:20px;
}

.share-button {
	font: 18px amatic sc;
}

.quote-button {
	font: 18px amatic sc;
}
            
          
!
            
              $.ajaxSetup({
    cache:false
});

	$.getJSON("https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
	  $(".quote").html(a[0].content + "<p>&mdash; " + a[0].title + "</p>");
	  $(".share-button").attr("href", twitterBaseURL + $(a[0].content).text() + " - " + a[0].title);
	});

$(".quote-button").click(function() {

	$.getJSON("https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
	  $(".quote").html(a[0].content + "<p>&mdash; " + a[0].title + "</p>");
	  $(".share-button").attr("href", twitterBaseURL + $(a[0].content).text() + " - " + a[0].title);	
	});
	
});

var twitterBaseURL = "https://twitter.com/intent/tweet?text=";

            
          
!
999px
Loading ..................

Console