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

              
                <div class="container-fluid">
	<h1 class="text-center" >Random Quotes</h1>
	<p class="lead text-center">Press the "New Quote" button to generate a random quote</p>
	<section id="buttonDiv">
		<button class="btn btn-large btn-primary" id="quoteBtn">New Quote</button>
	</section>
	<section id="Quote">
		<blockquote id="generatedQuote">
			<p id="quoteText"></p>
			<footer>
				<cite id="quoteAuthor"></cite>
			</footer>
		</blockquote>
	</section>
<section id="twt">
<a href="https://twitter.com/intent/tweet?text=Hello%20world" id="tweeter" target="_blank">
  <i class="fa fa-twitter"></i>Tweet</a>
  </section>
         
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Kaushan+Script|Alegreya+SC|Pacifico);

body {
  font-family: 'Kaushan Script', cursive;
  background: url(https://dl.dropbox.com/s/415oejkdh9c05tq/concrete_seamless.png?dl=0);
}

h1 {
  font-size: 400%;
  margin: 30px auto;
  text-shadow: 2px 2px 4px #111;
}

p {
  padding: 10px;
  letter-spacing: 0.09em;
  margin: 10px;
 
}

#buttonDiv {
  margin: 30px auto;
  text-align: center;
}

#quoteBtn {
  display: inline-block;
  width: 200px;
font-family: 'Pacifico', serif;
  font-size: 140%;
  padding: 10px;
  -webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}

#quoteBtn:hover {
  background-color: #999;
  color: #000;
}

#Quote {
  margin: 40px auto;
  text-align: center;
  width: 60%;
  padding: 5px;
  -webkit-box-shadow: -1px -1px 10px #292929;
  -moz-box-shadow: -1px -1px 10px #292929;
  box-shadow: -1px -1px 10px #292929;
}

#Quote p, cite{
 font-family: 'Alegreya', serif;
 font-size: larger;
}

#twt {
	margin: 40px auto;
  text-align: center;
	width: 90%;
	padding: 5px;
	position: relative;
}
#twt a {
	display: block;
	width: 120px;
	padding: 10px 15px;
  margin: 0 auto;
  text-align: center;
    background: #4479BA;
    color: #FFF;
    text-decoration: none;

    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    border: solid 1px #20538D;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
    -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
    -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);

}

#twt a:hover {
    background: #3994ef;
    color: #000;
    border: solid 1px #2A4E77;
    text-decoration: none;
}

#twt a:active {
    -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
    -moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
    background: #2E5481;
    border: solid 1px #203E5F;
    text-decoration: none;

}
              
            
!

JS

              
                
$(document).ready(function(){

   // $("#Quote").prop("hidden", true);
   $("#Quote").hide();
   $("#twt").hide();
   let quote ="";
  
  

	 $("#quoteBtn").click(function() {

		$.ajax({
     
      // url: 'https://crossorigin.me/https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json',
		  // url: 'https://quotes.stormconsultancy.co.uk/random.json',  
      // url: 'https://andruxnet-random-famous-quotes.p.mashape.com/cat=famous', 
      // The URL to the API. You can get this in the API page of the API you intend to consume
        url: 'https://cors-anywhere.herokuapp.com/https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json',
		    type: 'GET', // The HTTP Method, can be GET POST PUT DELETE etc
		    data: {}, // Additional parameters here
		    dataType: 'json',
		    success: function(data) { 
		    	console.log(data); 
		    	quote = "";
		          if($("#Quote").is(":hidden")) {
		            $("#Quote").show();
		            $("#twt").show();
		          }
		    	$("#quoteText").empty().append(data.quoteText);
		    	$("#quoteAuthor").empty().append(data.quoteAuthor)
          		quote += "\"" + data.quote + "\"" + " by " + data.author;

		    },
		    error: function(err) { alert(err); }
		  /*  
      beforeSend: function(xhr) {
		    xhr.setRequestHeader("X-Mashape-Authorization", "32ROUuaq9wmshfk8uIxfd5dMc6H7p1lqdZSjsnXkB5bQtBteLK"); // Enter here your Mashape key
		    }*/
		});

	});
  
  
   $("#tweeter").click(function() {
     $(this).attr("href", "https://twitter.com/intent/tweet?text="+quote);
   });


});
              
            
!
999px

Console