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

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

<div class = "container-fluid">
  
  <div class = "jumbotron" style="margin-top: 20px">
    <h3 align="center">Welcome to </h3>
                     
    <h4 align="center">the</h4>     
    <h3 align="center">21st Century</h3>
   </div>
                      
    <div class="jumbotron" style="background:black">
    <h1 align="center" style="color:white"> Random Quote Machine!</h1>
    </div>
                      
  <div class = "jumbotron" style= "background: white">
    <h5 align="center"> Hi! Click the button below to learn about a new quote today! </h5>
  </div>
  <div align="center">
    <btn class="btn btn-success" onclick="newQuote()">
      Generate a Quote
    </btn>
    <div id="quoteDisplay" class="jumbotron border-attr">
    </div>
    <div>
      <a id="tweet-share" onclick="tweetShare()" href="#" target="_blank">
        <btn class="btn btn-primary btn-twitter">
          <i class="fa fa-twitter fa-2x" aria-hidden="true"> <p1>Tweet this quote!</p1> </i>
        </btn>
</a> <!--How to insert URL into href? -->
    </div>
    

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

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Fredoka+One|Julius+Sans+One|Kreon');

@import url('https://fonts.googleapis.com/css?family=Clicker+Script');

@import url('https://fonts.googleapis.com/css?family=Clicker+Script');


.jumbotron {
  background-color: orange;
  padding: 30px;
  margin: 10px;
}


h1{
  font-family: 'Julius Sans One', sans-serif;
}

h3 {
  font-family: 'Fredoka One', cursive;
  font-size: 45px;
}

.quote-bg {
  background-image: url("http://wallpaper-gallery.net/images/wood-wallpaper/wood-wallpaper-24.jpg");
}

.border-attr {
  float: center;
  border-radius: 200%;
  margin-right: 10%;
  margin-left: 10%;
  padding: 12%;
}

.btn-twitter {
  padding: 2%;
} 

p1 {
  font-family: 'Clicker Script', cursive;
}

temp1{
  font-family: 'Clicker Script', cursive;
}



              
            
!

JS

              
                tweetUrl = "";

var forShareQuote="";

function newQuote() {
 
  var randNum = Math.floor(Math.random() * (quotesArr.length));
  
  var randQuote = quotesArr[randNum];
  
  document.getElementById('quoteDisplay').innerHTML = randQuote;
  
  $("#quoteDisplay").css("font-family", "Clicker Script", "cursive");
  $("#quoteDisplay").css("font-size", "50px");
  
  forShareQuote = randQuote;
  
 forShareQuote.replace(/\s/g,"+");
  
  tweetUrl = "https://twitter.com/intent/tweet?text=" + randQuote; 

   document.getElementById('tweet-share').setAttribute("href", tweetUrl);
}  






var quotesArr = [
  "I do the very best I know how - the very best I can; and I mean to keep on doing so until the end. – Abraham Lincoln",
  "Let us sacrifice our today so that our children can have a better tomorrow. – A. P. J. Abdul Kalam",
  "There is nothing permanent except change. – Heraclitus",
  "The most difficult thing is the decision to act, the rest is merely tenacity. The fears are paper tigers. You can do anything you decide to do. You can act to change and control your life; and the procedure, the process is its own reward. – Amelia Earhart",
  "Learning never exhausts the mind. – Leonardo da Vinci",
  "There is no charm equal to tenderness of heart. – Jane Austen",
  "Good judgment comes from experience, and a lot of that comes from bad judgment. – Will Rogers"
]




              
            
!
999px

Console