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.

              <div id='quotebox'>
  <h2 id='title'>Rachel's Chuck Norris<br>Quote Generator</h2>

  <div id='wrapper' class='center-block'>
  <blockquote id='quote'></blockquote>

  <div class='row'>
    <button class='btn center-block pull-right' id='quote-button'>Get a quote!</button>
    <div id='tweet' class='btn pull-right'></div>

<script>window.twttr = (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0],
    t = window.twttr || {};
  if (d.getElementById(id)) return t;
  js = d.createElement(s);
  js.id = id;
  js.src = "https://platform.twitter.com/widgets.js";
  fjs.parentNode.insertBefore(js, fjs);
  t._e = [];
  t.ready = function(f) {
  return t;
}(document, "script", "twitter-wjs"));</script>
              body {
  background: #818AA3;
  color: #818AA3;

#quotebox {
  position: relative;
  border-radius: 3px;
  position: relative;
  margin: 8% auto auto auto;
  width: 450px;
  padding: 25px 50px;
  display: table;
  background-color: #fff;

#title {
  text-align: center;

#quote-button {
  background-color: #A491D3;
  color: white;
  display: inline-block;
  margin-left: 10px;

#wrapper {
  display: none;
  margin-top: 25px;
  width: 450px;

#quote {
  font-style: italic;
  font-size: 18px;
  color: green;

#tweet {
  display: none;
  margin-right: auto;
  margin-left: auto;
  background: #1da1f2;

#tweet a {
  text-decoration: none;
  color: white;
              function getTweet() {
  $.getJSON("https://api.icndb.com/jokes/random", function (json) {
    var joke = json.value.joke;
    var tweetLink = '<a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=' + joke + '"><i class="fa fa-twitter" aria-hidden="true"></i> Tweet</a>';
    $('#tweet').css('display', 'inline-block');
$( document ).ready(function() {
$("#quote-button").on("click", function() {


Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................