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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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">
  <h1>&quot;Quote of The Day&quot;</h1>
  <div class="quote-box">
    <div class="col-md-12">
      <div class="row"><i class="fa fa-quote-left"></i>
        <span id="quoteDisplay"></span>
      </div><br>
      <div class="buttons">
        <span id="tweet">
          <a href="yo" data-toggle="tooltip" title="Tweet the Quote" target="_blank">
            <button class="btn raise" onclick="tweetIt()" id=tweetbutton><i class="fa fa-twitter"></i></button>
          </a>
        </span>
        <button class="btn btn-primary raise" onclick="changeColor(); newQuote();" id="newquote">New Quote</button>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                @import url(http://fonts.googleapis.com/css?family=Raleway:400,500);
h1{
  font-family: 'Pacifico', cursive;
  text-align : center;
  font-size: 50px;
  color: white;
  margin:8%;
}
.quote-box{
    border-radius:3px;
    margin:5% auto auto auto;
    max-width:500px;
    padding:40px 40px;
    background-color : #f7f7f7;
}
#quoteDisplay{
    font-family: 'Raleway', sans-serif;
    font-size: 22px;
    text-align: center;
}
i{
    font-size: 1em;
    margin-right: 0.7em;
}
.buttons{
  max-width :500px;
  margin:auto;
  display:block;
  padding: 10px 10px 10px 10px;
  height:40px;
}
#tweetbutton{
      float:left;
      text-align:center;
      color:blue;
  padding-left:15px;
  padding-right:5px;
    }
#newquote{
      float:right;
    }
button:hover{
  opacity:0.7;
}
.raise:hover {
  transform: translateY(-0.15em);
}
              
            
!

JS

              
                var quotes=[
    'Don\'t cry because it\'s over, smile because it happened. ― Dr. Seuss',
    'Be yourself, everyone else is already taken. ― Oscar Wilde',
    'Two things are infinite: the universe and human stupidity, and I\'m not sure about the universe. ― Albert Einstein',
    'A room without books is like a body without a soul. ― Marcus Tullius Cicero',
    'You only live once, but if you do it right, once is enough. ― Mae West',
    'Be the change that you wish to see in the world. ― Mahatma Gandhi',
    'In three words I can sum up everything I\'ve learned about life: it goes on. ― Robert Frost',
    'If you tell the truth, you don\'t have to remember anything. ― Mark Twain',
    'Always forgive your enemies; nothing annoys them so much. ― Oscar Wilde',
    'If you want to know what a man\'s like, take a good look at how he treats his inferiors, not his equals. ― J.K. Rowling',
    'Success is getting what you want. Happiness is wanting what you get. ― Dale Carnegie',
    'Anytime you see a turtle up on top of a fence post, you know he had some help. ― Alex Haley',
    'There is much pleasure to be gained from useless knowledge. ― Bertrand Russell',
    'Don\'t pray when it rains if you don\'t pray when the sun shines. ― Satchel Paige',
    'The foot feels the foot when it feels the ground. ― Buddha',
    'Nothing makes one feel so strong as a call for help. ― Pope Paul VI',
    'You can get assent to almost any proposition so long as you are not going to do anything about it. ― Nathaniel Hawthorne'
]
var currentQuote='';
function newQuote() {
    var randomNumber=Math.floor(Math.random()*quotes.length);
    currentQuote=quotes[randomNumber];
    document.getElementById('quoteDisplay').innerHTML = currentQuote;
}
newQuote();
function changeColor() {
    var colors=[
        '#16a085', '#27ae60', '#2c3e50', '#f39c12', '#e74c3c', '#9b59b6', '#FB6964', '#342224', "#472E32", "#BDBB99", "#77B1A9", "#73A857"
    ];
    var selectedColor=colors[Math.floor(Math.random()*colors.length)];
    $("body").css("background-color",selectedColor);
}
changeColor();
function tweetIt() {
    var link='https://twitter.com/intent/tweet?text='+currentQuote;
    $("a[href='yo']").attr('href',link);
}
              
            
!
999px

Console