Pen Settings



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


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


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.


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.



    Random Quote


  <div class="main">
    <div class="container">
      <div class="row text-center">
        <div class="message col-xs-12 col-md-6 col-md-offset-3">
          <h1>Random Quote Machine</h1>
      <div class="row text-center">
        <div id="mess" class="message col-xs-12 col-md-8 col-md-offset-2">
          <div class="quote">
          <div class="author text-right">
    <div class="row text-center">
      <div class="col-xs-12 col-md-12">
        <button id="getMessage" class="btn">
          Get Quote
        <button id="tweet" class="btn">
          <i class=" fa fa-twitter"></i>
          Tweet It




                .typed-cursor {
  display: none;

body {
  background-color: #F012BE;
  transition: all 1s;
  font-family: "Architects Daughter", monospace;
  text-shadow: 2px 2px 5px;

.message {
  font-size: 2em;
  border-radius: 10px;
  transition: all 1s;
  margin-bottom: 20px;
  margin-top: 20px;


button {
  background-color: #B10DC9;


                $(document).ready(function() {
  var html = "";
  var author = "";
  var clickDisabled = false;
  $("#getMessage").click(function() {
    } else {
  $.getJSON("[orderby]=rand&filter[posts_per_page]=1?", function(a) {
      html = a[0].content;
      author = a[0].title;
      $(".author").append('<em>-' + a[0].title + '</em>');
    clickDisabled = true;
    setTimeout(function(){clickDisabled = false;}, 5000);

  $('#tweet').click(function(e) {
    var textToTweet = "Hi I am tweeting from here";
    if ((html.length + author.length + 2) > 140) {
      alert('Tweet should be less than 140 Chars');
    } else {
      var twtLink = '' + encodeURIComponent(html + "\n -" + author);, '_blank');

function logResults(json){

function typeIt(param) {
  $(function() {
      strings: [param],
      typeSpeed: 0
var colors = [
  ["#001f3f", "#0074D9"],
  ["#0074D9", "#7FDBFF"],
  ["#7FDBFF", "#39CCCC"],
  ["#39CCCC", "#3D9970"],
  ["#3D9970", "#2ECC40"],
  ["#2ECC40", "#01FF70"],
  ["#01FF70", "#3D9970"],
  ["#FFDC00", "#FF851B"],
  ["#FF851B", "#FF4136"],
  ["#FF4136", "#85144b"],
  ["#85144b", "#B10DC9"],
  ["#e8dab2", "#4f6d7a"],
  ["#ee85b5", "#441151"],
  ["#35605a", "#00120b"],
  ["#610345", "#e07be0"],
  ["#f4a259", "#896740"],
  ["#241623", "#d0cd94"],
  ["#B10DC9", "#FF4136"]

function changeBackgroundColor() {
  var color = (Math.floor(Math.random() * 18)) ; = colors[color][0];
  document.getElementById("mess").style.color = colors[color][0];
  document.getElementById("mess").style.background = colors[color][1]; = colors[color][0];
  document.getElementById("tweet").style.background = colors[color][1];
  document.getElementById("getMessage").style.background = colors[color][1];
  document.getElementById("tweet").style.color = colors[color][0];
  document.getElementById("getMessage").style.color = colors[color][0];