css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

  <!-- Links for fonts, and font awesome icons -->
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

  <link href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,700" rel="stylesheet">

  <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">

  <!--  -->

  <!-- Container for quote generator  -->
  <div class="quote-container">

    <div id="quote" class="quoteText">
      <p id="quote"> All men by nature desire to know.</p> 
    <div id="author" class="quoteAuthor">
      <footer id="author">- Aristotle</footer>
    <div class="buttons">
      <a id="tweet" href="#" target="_blank"><i id ="twitter"class="fa fa-twitter fa-5x" aria-hidden="true"></i></a>
      <a href="#" id="get-quote"><i class="fa fa-chevron-circle-right fa-5x" aria-hidden="true"></i></a>

              h1 {
  font-family: "Montserrat", sans-serif;
  color: #e3f2fd;
  font-size: 40px;
  text-align: center;
  font-weight: bold;

body {
  /*background color if browser doesn't super gradient */
  background-color: #00212e;
  /* gradient style for background if browser supports it */
  background-image: linear-gradient(to right, #26A69A, #303F9F);
  /*font style for body elements */
  font-family: "Montserrat", sans-serif;
  color: #00212e;
  font-weight: bold;

.quote-container {
  background-color: #e3f2fd;
  width: 550px;
  height: auto;
  position: relative;
  display: block;
  padding: 40px 50px;
  margin: auto;

.quoteText {
  font-size: 25px;
  text-align: left;
  color: #263238;

.quoteAuthor {
  font-size: 20px;
  color: #263238;
  display: block;
  float: right;
  margin-top: 2%;
  margin-bottom: 2%;
  margin-right: 5%;

  display: inline-block;
  text-align: center;
  margin-top: 20px;
  margin-left: 160px;

.get-quote {
  color: #e3f2fd;
  margin-top: 3%;

.get-quote: hover{
  opacity: 0.9;
  color: #fff;

.send-tweet {
  color: #e3f2fd;
  margin-top: 3%;
              var api = "https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?";
var getQuote = function(data){
  if (data.quoteAuthor === "") {
    data.quoteAuthor = "Unknown";

  $("#author").text("- " + data.quoteAuthor);
  $('#tweet').attr('href', 'https://twitter.com/intent/tweet?text=' + encodeURIComponent('"' + data.quoteText + '"' + '- ' +  data.quoteAuthor));

//For the first quote which is the same by default 
var firstQuote = "All men by nature desire to know.";
var firstAuthor = "Aristotle";

$('#tweet').attr('href', 'https://twitter.com/intent/tweet?text=' + encodeURIComponent('"' + firstQuote + '"' + '- ' + firstAuthor));
$("#get-quote").on("click", function() {

	$.getJSON(api, getQuote, 'jsonp');


🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................