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

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

              
                <head>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
</head>
<link href='//fonts.googleapis.com/css?family=Alegreya' rel='stylesheet'>
<link href='//fonts.googleapis.com/css?family=Domine' rel='stylesheet'>
<div class="container-fluid text-center">
  <h1>Random Quote Generator</h1>
  <br/>
  
  <!--A div that would store the author and the quote in a box with a border-->
  <div class="quotes">
    <i class="fa fa-quote-left fa-3x fa-pull-left fa-border" aria-hidden="true"></i>
    <span class="quote">Hello World!</span>
    <span class="author">-The World</span>
    <div class="row">
      <div class="col-md-6"><a class="btn btn-block btn-sample" href="#" target="_blank" id="tweet">
        <i class="fa fa-twitter pull-left"></i>Tweet Out</a></div>
      <div class="col-md-6"><button class="btn btn-block btn-sample"  id="newQuote">
        <i class="fa fa-cloud pull-left"></i>New Quote</button></div>

    </div>
  </div>
</div>
  

              
            
!

CSS

              
                body{
  background-color: #5d627b;
  font-family: Domine;
}
h1{
  font-family: Alegreya;
  font-size: 50px;
  color: white;
}
.quotes{
  background-color: #35384c;
  width: 33%;
  margin-right: auto;
  margin-left: auto;
  margin-top: 10px;
  border-style: solid;
  border-radius: 10px;
  padding: 50px;
  height: auto;
  color: white;
}
.quote{
  font-size: 30px;
}
.author{
  font-size: 20px;
}

.btn-sample { 
  color: #ffffff; 
  background-color: #9396A7; 
  border-color: #9396A7; 
  margin-top: 20px;
} 
 
.btn-sample:hover, 
.btn-sample:focus, 
.btn-sample:active, 
.btn-sample.active { 
  color: #ffffff; 
  background-color: #6f738a; 
  border-color: #9396A7; 
} 
              
            
!

JS

              
                $(document).ready(function(){
  var randomQuote;
  var randomNum;
  var randomAuthor
  function getQuote(){
    
    var quotes = ["Hello, World!", "How you doing?", "I bet you're good!"];
    var authors = ["-Me", "-Myself", "-And I"];
  
    randomNum = Math.floor(Math.random()*quotes.length);
    randomQuote = quotes[randomNum];
    randomAuthor = authors[randomNum];
  
    $(".quote").text(randomQuote);
    $(".author").text(randomAuthor);
}
  $("#newQuote").on("click", function(){
    getQuote();
  });
  
  $('#tweet').on("click", function(){
    window.open("https://twitter.com/intent/tweet?text="+randomQuote);
  });
});
              
            
!
999px

Console