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 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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              
<div class=" bg container text-center">
  <h1>Random Inspirational Qoute</h1>
    <p> A quick pick me up for your spirits</p>
  <div id ="buttons" >
    <div class="row">
      <div class = "col-md-1 col-md-offset-5">
  <button class =" newQ btn btn-success" type="submit">next</button></div>
        <div class = "col-md-1">
  <a href="#" class ="newT btn btn-info">Tweet</a>
  
        </div>
       </div>
    </div>

<div id ="statements" >
  <h3 class="qoute"></h3>
  <p class="author"></p>
</div>
  </div>
  
  
            
          
!
            
              body{background: url("https://s-media-cache-ak0.pinimg.com/originals/0b/7b/7f/0b7b7f15b83e7326de9078d0998d5eac.jpg")  no-repeat fixed;}
p,
h1,
h3
{ color:white;}
.bg{ background: rgba(47,79,79,.5);
margin: 0 auto;
border-right:5px solid #00FFFF;
  border-top:5px solid #00FFFF;}
#statements{
  margin:40px 0px;
  border: 3px solid #008080;
  background:black;
}

#buttons{
  margin-top:40px;
}
            
          
!
            
              $(document).ready(function() {
  var randomAuthors;
  var randomStatments;
  var randomNum;
 newStatements();

  function newStatements() {


   var statements = ["It is not in the stars to hold our destiny but in ourselves.", "Education is the passport to the future, for tomorrow belongs to those who prepare for it today.", "Even though the future seems far away, it is actually beginning right now."];
     
     var authors = ["-William Shakespeare", "-Malcolm X", "-Mattie Stepanek"];

     randomNum = Math.floor((Math.random()*statements.length));
     randomStatments = statements[randomNum];
     randomAuthors = authors[randomNum];

     $(".qoute").text(randomStatments);
     $(".author").text(randomAuthors);
  };

  $(".newT").on("click", function() {
    window.open("https://twitter.com/intent/tweet?text=" + randomStatments + ""+ randomAuthors);
  });

  $(".newQ").on("click", function() {
    newStatements();

  });

});
            
          
!
999px
🕑 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 ..................

Console