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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Tangerine">
 <div class="container-fluid" id="quote-box">
  <div class = "row text-center">
   <h1 id="heading">Quotation of the Day</h1>
  </div>
  <div class = "row text-center">
    <div class = "col-xs-12 well message">
	<div>
      <div>
        <p id="text"></p>
        <p id="author"></p>
		<img id="myImg">
      </div>
	</div> 
    </div>
  </div>
  <div class = "row text-center">
    <div class = "col-xs-12">
      <button id = "new-quote"class="btn btn-primary" title="generate a new quote">
        View Quote
      </button>
<a id="tweet-quote" class="btn btn-info" title="share on twitter"><i class="fa fa-twitter pr-1"></i>Tweet This!</a>
    </div>
  </div>
</div>
  </body>
</html>
              
            
!

CSS

              
                body{
  background-color: #8dc7d3;
}
#heading {
  font-family: 'Tangerine', serif;
	font-style: normal;
	font-variant: normal;
	font-weight: bold;	
}
	.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    color: white;
    text-align: center;
}
.container-fluid {
  max-width: 500px;
 margin-top: 100px;
}
#new-quote{
  font-weight: bold;
}
#tweet-quote {
    font-weight: bold;
  }
              
            
!

JS

              
                
$( document ).ready(function() {
	generatequotes();
function generatequotes () {
var quotes = [{
  quote: "Treachery and violence are spears pointed at both ends they wound those who resort to them worse than their enemies.",
  author: "Emily Bronte (1818-1848)",
  img: "http://img.tfd.com/IOD/bronteE.jpg"
},
 {
   quote: "Trust men and they will be true to you; treat them greatly and they will show themselves great.",
  author:"Ralph Waldo Emerson (1803-1882)",
  img:"http://img.tfd.com/IOD/emerson.jpg"
},
{ 
  quote: "You will hear people say that poverty is the best spur to the artist. They have never felt the iron of it in their flesh. They do not know how mean it makes you. It exposes you to endless humiliation, it cuts your wings, it eats into your soul like a cancer.",
  author:"W. Somerset Maugham (1874-1965)",
  img: "http://img.tfd.com/IOD/maugham.jpg"
},
{
  quote: "Now, I hold it is not decent for a scientific gent To say another is an ass-at least, to all intent, Nor should the individual who happens to be meant Reply by heaving rocks at him to any great extent.",
  author:"Bret Harte (1836-1902)",
  img:"http://img.tfd.com/IOD/harte.jpg"
},
{quote: "There is nothing more deceptive than an obvious fact.",
  author:"Arthur Conan Doyle (1859-1930)",
  img: "http://img.tfd.com/IOD/doyle.jpg"
},
{quote: "A fool with a heart and no brains is just as unhappy as a fool with brains and no heart.",
  author:"Fyodor Dostoyevsky (1821-1881)",
  img:"http://img.tfd.com/IOD/dostoyevsky.jpg",
},
{quote: "Well, I really don't advise a woman who wants to have things her own way to get married.",
  author:"Virginia Woolf (1882-1941)",
  img: "http://img.tfd.com/IOD/woolf.jpg"
},
{
  quote: "The voice of the sea speaks to the soul.",
  author:"Kate Chopin (1851-1904)",
  img:"http://img.tfd.com/IOD/chopin.jpg"
}];
var randomNumber= Math.floor(Math.random() * quotes.length);
document.getElementById("text").innerHTML=quotes[randomNumber].quote;
document.getElementById("author").innerHTML=quotes[randomNumber].author;
document.getElementById("myImg").src = quotes[randomNumber].img;
var share =quotes[randomNumber].quote + quotes[randomNumber].author;
share = encodeURIComponent(share);
$('#tweet-quote').attr('href', 'https://twitter.com/intent/tweet?text='+share).attr('target', '_blank');}
$("#new-quote").on( "click", function() {
    generatequotes();
});  
  
});

              
            
!
999px

Console