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>Random Wisdom Machine</h1>
  <p class="intro">These are some words of wisdom that I have collected while searching the internet. Enjoy.</p>
  <div class="centererer">
    <button class="btn btn-primary">Generate Wisdom</button>
  </div>
  <div class="box">
    <p class="quote"></p>
    <p class="author"></p>
  </div>
</div>
              
            
!

CSS

              
                .container {
  background-color: #fff;
  margin-top: 30px;
}

h1,
.intro {
  text-align: center;
  font-family: serif;
}

.intro {
  font-size: 18px;
}

.centererer {
  text-align: center;
  margin: auto;
}

.box {
  margin: 20px auto;
  padding: 20px 20px 10px 25px;
  border: 2px solid #95a5a6;
  border-radius: 20px;
  background-color: #ecf0f1;
  width: 80%;
}

.quote {
  font-family: serif;
  font-style: italic;
  font-size: 24px;
}

.author {
  font-family: sans-serif;
  text-align: right;
  font-size: 18px;
  padding-right: 20px;
}

              
            
!

JS

              
                var quotes = [["You must do the things you think you cannot do.","Eleanor Roosevelt"],["We can't help everyone, but everyone can help someone.","Ronald Reagan"],["How wonderful is it that nobody need wait a single moment before starting to improve the world.","Anne Frank"],["Only those who have learned the power of sincere and selfless contribution experience life's deepest joy: true fulfillment.","Tony Robbins"],["Create each day anew.","Morihei Ueshiba"],["The mind is everything. What you think you become.","Buddha"],["There is only one way to avoid criticism: do nothing, say nothing, and be nothing.","Aristotle"],["What’s money? A man is a success if he gets up in the morning and goes to bed at night and in between does what he wants to do.","Bob Dylan"],["I would rather die of passion than of boredom.","Vincent van Gogh"],["The moment you doubt whether you can fly, you cease for ever to be able to do it.","J.M. Barrie"],["I like to listen. I have learned a great deal from listening carefully. Most people never listen.","Ernest Hemingway"],["Love sought is good, but given unsought, is better.","William Shakespeare"],["Work hard in silence, let success be your noise.","Frank Ocean"],["The people who are crazy enough to think they can change the world are the ones who do.","Steve Jobs"],["You can’t do sketches enough. Sketch everything and keep your curiosity fresh.","John Singer Sargent"],["A different language is a different vision of life.","Federico Fellini"],["For every complex problem there is an answer that is clear, simple, and wrong.","H.L. Mencken"],["It is better to know some of the questions than all of the answers.","James Thurber"],["Whatever you are, be a good one.","Abraham Lincoln"],["Far and away the best prize that life has to offer is the chance to work hard at work worth doing.","Theodore Roosevelt"],["Work hard, be kind, and amazing things will happen.","Conan O’Brien"],["A person who won’t read has no advantage over one who can’t read.","Mark Twain"],["The more that you read, the more things you will know. The more that you learn, the more places you’ll go.","Dr. Seuss"],["Words are, in my not-so-humble opinion, our most inexhaustible source of magic.","Albus Dumbledore"],["It is the mark of an educated mind to be able to entertain a thought without accepting it.","Aristotle"],["The price of anything is the amount of life you exchange for it.","Henry David Thoreau"],["Life cannot be better than your mindset.","Arvind Krish"],["Knowing is not enough; we must apply. Willing is not enough; we must do.","Johann Wolfgang von Goethe"],["Persistence! Nothing in this world can take the place of good old persistence. Talent won’t. Nothing’s more common than unsuccessful men with talent. Genius won’t. Unrecognized genius is practically a cliche. Education won’t. Why the world is full of educated fools. Persistence and determination alone are all powerful.","Unknown"],["If you want something you never had, you have to do something you’ve never done.","Unknown"],["If you want to change your life, begin by changing your words. Start speaking the words of your dreams, of who you want to become, not the words of fear and failure.","Robert Kiyosaki"],["It’s the best feeling in the world when you have something to look forward to every single morning.","Ronda Arousmey"],["Envision your best self, and act accordingly.","Unknown"],["Document the moments you feel most in love with yourself-what you’re wearing, who you’re around, what you’re doing. Recreate and repeat.","Warsan Shire"],["Whatever you can do or dream you can, begin it. Boldness has genius, power, and magic in it.","Johann Wolfgang von Goethe"],["If you talk to a man in a language he understands, that goes to his head. If you talk to him in his language, that goes to his heart.","Nelson Mandela"],["Study while others are sleeping. Work while others are loafing. Prepare while others are playing. Dream while others are wishing.","William A. Ward"],["You will never be 100% ready, just start.","Bill Gates"]];
var generate = function() {
  var arr = quotes[Math.floor(Math.random() * (quotes.length))];
  $('.quote').text(arr[0]);
  $('.author').text(arr[1]);
};

$(function(){
  generate();
});

$('.btn').on('click', function() {
  generate();
});  
              
            
!
999px

Console