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.

              <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"/>

<link href="https://fonts.googleapis.com/css?family=Bitter|Roboto" rel="stylesheet">

<div class="container" style="background-color: white; padding:0">
  <!-- header -->
  <div class="row">
  <h1 class="serifed sm-center buffer" style="font-size:7em"> Literary Quotes 
    <img src="https://github.com/koolhany/freecodecamp2/blob/master/typewriter.jpg?raw=true" height=100></img>
<!--quote + bg-->
  <div class="row">
    <div class="fixed-bg">
<h1 id = "q" class="sm-center big-buffer"> A Quote </h1>
<!--author + buttons-->
<div class="row">
<h2 id = "a" class="serifed author-buff mobile-center"> an author </h2>
  <div class="row mobile-center">
    <p class="takeAction author-buff"> <a class="on-white" id = "butt" style="color:black">Read another quote,</a><br class="big-hidden"> <a class="on-white" id="tweeted"style="color:black" 
                                                                                                                                             target="_blank"><i class="fa fa-twitter"></i> Tweet this quote</a></p>
<!-- footer-->
<div class ="mobile-center" id="footer" style="padding:20px">
  <p style="color:white; margin-top:20px">This is a <a class="on-white" style="color:white" href="https://www.freecodecamp.com/" target="_blank">Free Code Camp</a> project by <a href="http://www.rachelkochany.com/" target="_blank" class="on-white" style="color:white">Rachel Kochany</a></p>
              body {
background-color: black;

/*quote block*/
.fixed-bg {
  background-image:   url('https://raw.githubusercontent.com/koolhany/freecodecamp2/be3eed553a8c61b95e0226e16e0ea9a3b1c972c9/quotes.png'),
  background-position:5% 0px, 95% 100%;

.fixed-bg h1 {

#q {
.takeAction {
.serifed {
/*footer background*/
#footer { 
   width: 100%;
   height: 100%;
   background-image: url('https://github.com/koolhany/freecodecamp2/blob/master/torn-bg.png?raw=true');
   background-size: contain;

@media (max-width: 992px) {
    .sm-center {

@media (min-width: 992px) {
  .buffer {
  .big-buffer {

@media (min-width: 762px) {
    margin-left: 30px;
  .big-hidden {

@media (max-width:762px) {

@media (max-width:480px) {
  .hidden-small {
var quotes = [{quote: "If it can be destroyed by the truth, it deserves to be destroyed by the truth.", author: "Carl Sagan"},
             {quote: "The best way to find out if you can trust somebody is to trust them.", author: "Earnest Hemmingway"},
             {quote: "Any writer worth his salt writes to please himself.", author: "Harper Lee"},
             {quote: "Let your plans be dark and impenetrable, and when you move, fall like a thunderbolt.", author:"Sun Tzu"},
             {quote: "Appear weak when you are strong, and strong when you are weak.", author:"Sun Tzu"},
             {quote: "I do things like get in a taxi and say, \"The library, and step on it\".", author: "David Foster Wallace" },
             {quote: "I took a deep breath and listened to the old brag of my heart. I am, I am, I am", author:"Sylvia Plath"},
             {quote:"And now that you don\'t have to be perfect, you can be good", author:"John Steinbeck"},
             {quote:"I have spread my dreams under your feet. Tread softly because you tread on my dreams.", author:"W. B. Yeats"},
             {quote:"It does not do well to dwell on dreams and forget to live, remember that.", author:"J. K. Rowling"},
             {quote:"I will speak daggers to her, but use none", author:"William Shakespeare"},
             {quote:"Love sought is good, but giv'n unsought is better", author:"William Shakespeare"},];

var oneRando = Math.floor(Math.random()*quotes.length);
$("#a").text("\u2014 "+quotes[oneRando].author);

$("#tweeted").attr("href","https://twitter.com/home?status=\""+quotes[oneRando].quote+"\""+"\u2014 "+quotes[oneRando].author)

$("#butt").on("click", function() {
  var rando = Math.floor(Math.random()*quotes.length);
$("#a").text("\u2014 "+quotes[rando].author);
$("#tweeted").attr("href","https://twitter.com/home?status=\""+quotes[rando].quote+"\""+"\u2014 "+quotes[rando].author)
🕑 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 ..................