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 text-center">
  <h1> Quotes About Life </h1>
  </br>
  <button class="mybutton" type=submit> New Quote </button>
<div class="quotes">
  <span class="quote"> Hello World !! </span>
  <span class="author">The World</span>
</div>



</div>
              
            
!

CSS

              
                * body
{
  background-color:black;
}
* h1
{
  color:white;
  font-family:"Times New Roman";
  font-size:40px;
}
* button
{    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
  margin-bottom:20px;
}
.quotes
{
  background:gray;
  width:33%;
  margin-right:auto;
  margin-left:auto;
  border-color:white;
  border-style:solid;
  border-radius:5px;
  padding:20px;
  height:auto;
  color:white;
  font-size:30px;
}
.author
{
  font-size:20px;
 font-family:"Times New Roman"; 
  font-style:italic;
}
.container
{
  text-align:center;
}
              
            
!

JS

              
                $(document).ready(function(){
  function getQuote()
  {
    var quotes=["Only I can change my life. No one can do it for me.","There is only one happiness in this life, to love and be loved.","Life is 10% what happens to you and 90% how you react to it.","The greatest gift of life is friendship, and I have received it."];
    var authors=["Carol Burnett","George sand","Charles R. Swindoll","Hubert H. Humphrey"];
    var randomNum=Math.floor((Math.random()*quotes.length));
    var randomQuote=quotes[randomNum];
    var randomAuthor=authors[randomNum];
    $(".quote").text(randomQuote);
    $(".author").text(randomAuthor);
  }
    $(".mybutton").on("click",function()
    {
      getQuote();
    });
  
  
});

              
            
!
999px

Console