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

              
                <div class=container id="everything"> 
  <div id=title class="row">
    <h1 class= "col-md-12">BECAUSE CHUCK NORRIS!</h1>
  </div>
  
    <div id=quote class= "row">
      <h4 id='quote-content'class="col-md-12"> </h4>
      
    </div>
  
  <div id="buttons"class="row">
    <div class="col-md-12">
    <button id="getQuote" class="get-Quote">GET INSPIRED!</button>
      <button><a href=https://www.twitter.com target="blank">TWEET IT!</button>
   </div> 
</div>
              
            
!

CSS

              
                body{
  background-color:#00ffff;
 }
#title{
  text-align:center;
  margin-top:100px;
}
#quote{
  display:block;
  text-align:center;
  margin-top:75px;
  margin-left:300px;
  margin-right:300px;
  padding-top:15px;
  padding-bottom:15px;
   border-style:dotted; 
}
#buttons{
  text-align:center;
  margin-top:10px;
  margin-bottom:10px;
}
              
            
!

JS

              
                

$(document).ready(function(){

  var quote;
  
  function getNewQuote(){ //GRABS DATA FROM API
    $.ajax({
      url: 'https://api.chucknorris.io/jokes/random',
      success: function(response){
        quote=response.value; //SETS QUOTE VALUE TO quote
        $('#quote-content').text(quote); //puts quote in id=quote-content
        }
    });
  };
  getNewQuote(); //runs getNewQuote function so there is a quote when page loads
  
  $('.get-Quote').on('click', function(event){ // makes button with class get-Quote run getNewQuote function
    event.preventDefault(); //stops page from resetting position when button is clicked
    getNewQuote();
    
  });
});

  
              
            
!
999px

Console