cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Random Quote Machine</title>
        <link href="https://fonts.googleapis.com/css?family=Montserrat|Open+Sans" rel="stylesheet">
        <link href="http://six03.com/quotes/style.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <div class="container">
            <div class="top">
                <h1>Random Quotes</h1>
                <p>A random collection of quotations designed to make you look philosophical.</p>
            </div>

            <div class="bottom">
                <blockquote id="quote"></blockquote>
                <span></span>
                <ul id="buttons">
                    <li><a href="" id="click">More Quotes</a></li>
                    <li><a href="" id="twitter" target="_blank">Tweet this</a></li>
                </ul>
            </div>
        </div>
        <script src="//six03.com/quotes/script.js" type="text/javascript"></script>
            
          
!
            
              * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body, html {
    height: 100%;
}
body {
    font-family: 'Open Sans';
    color: #fff;
}
.container {
    height: 100%;
    background: #c93514;
    text-align: center;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-direction: normal;
    -webkit-box-orient: horizontal;
    -webkit-flex-direction: row-reverse;
    -moz-flex-direction: row-reverse;
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
    font-family: 'Open Sans', sans-serif;
}
.container div{
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-direction: normal;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    -moz-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    -moz-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    -moz-justify-content: center;
    justify-content: center;
}
.top {
    padding: 0 20px;
}
.top h1 {
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    margin-bottom: 10px;
}
.bottom {
    width: 80%;
    color: black;
    padding: 90px 0;
    background-color: white;
    font-family: 'Montserrat', sans-serif;
}
.bottom blockquote {
    font-family: 'Open Sans', sans-serif;
    margin: 0 50px 10px 50px;
    font-weight: 900;
    font-size: 1.4rem;
}
.bottom span {
    border: 1px solid #ddd;
    width: 60%;
    margin-top: 5px;
}
.bottom a {
    display: block;
    text-decoration: none;
    font-family: 'Open Sans', sans-serif;
    background: #55acee;
    color: #fff;
    font-size: 0.75em;
    padding: 15px 30px;
    border: 1px solid #ccc;
    margin-top: 10px;
    -moz-transition: border, background 0.2s;
    -o-transition: border, background 0.2s;
    -webkit-transition: border, background 0.2s;
    transition: border, background 0.2s;
}
ul#buttons {
    width: 400px;
}
.bottom li {
    display: inline;
    float: left;
    width: 200px;
    padding: 0 20px;
}
.bottom li a#click {
    background: #152935;
    color: white;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    -moz-transition: border, background 0.2s;
    -o-transition: border, background 0.2s;
    -webkit-transition: border, background 0.2s;
    transition: border, background 0.2s;
}
.bottom a#click:hover {
    background: #152935;
    border: 1px solid white;
    color: white;
    -moz-transition: border, background 0.2s;
    -o-transition: border, background 0.2s;
    -webkit-transition: border, background 0.2s;
    transition: border, background 0.2s;
}
            
          
!
            
              var quote = document.getElementById('quote');
var click = document.getElementById('click');
var quoteList = ["\'You will never be happy if you continue to search for what happiness consists of. You will never live if you are looking for the meaning of life.\'", "\'A life spent making mistakes is not only more honorable, but more useful than a life spent doing nothing.\'", "\'In vain have I struggled. It will not do. My feelings will not be repressed. You must allow me to tell you how ardently I admire and love you.\'", "\'It is better to remain silent at the risk of being thought a fool, than to talk and remove all doubt of it.\'", "\'Have you ever been in love? Horrible isn\'t it? It makes you so vulnerable. It opens your chest and it opens up your heart and it means that someone can get inside you and mess you up.\'", "\'The problem with the world is that the intelligent people are full of doubts, while the stupid ones are full of confidence.\'", "\'Ok. You fuck me, then snub me. You love me, you hate me. You show me a sensitive side, then you turn into a total asshole. Is this a pretty accurate description of our relationship.\'", "\'If I had a flower for every time I thought of you...I could walk through my garden forever.\'", "\'Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.\'", "\'Never tell the truth to people who are not worthy of it.\'", "\'The one you love and the one who loves you are never, ever the same person.\'", "\'Becoming fearless isn\'t the point. That\'s impossible. It\'s learning how to control your fear, and how to be free from it.\'", "\'I hope she\'ll be a fool -- that\'s the best thing a girl can be in this world, a beautiful little fool.\'"];

var randomQuote = function(){
    var twitter = document.getElementById('twitter');
    var index = Math.floor(Math.random()*quoteList.length);
    twitter.href = "https://twitter.com/intent/tweet?text=" + encodeURI(quoteList[index]);
    quote.innerHTML = quoteList[index];
};

randomQuote();

click.addEventListener('click', randomQuote, false);
            
          
!
999px
Loading ..................

Console