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. 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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div id = "quotebox"></div>
<p id = "quotebox_info">Click the above box to get a new quote.</p>
              body {
  background-color: rgb(48, 60, 81);

#quotebox {
  width: 50%;
  margin: 0 auto;
  background-color: gray;
  height: 300px;
  border: 1px solid black;
  border-radius: 25px;

#quotebox p {
  color: white;
  font-family: sans-serif;
  font-size: 36px;
  text-align: center;
  padding: 20px;

#quotebox h3 {
  color: rgb(219, 232, 255);
  text-align: center;

.twitter-share-button {
  background-color: rgb(66, 134, 244);
  color: white;
  border: 5px solid blue;
  border-radius: 2px;
  display: block;
  text-decoration: none;
  width: 10%;
  margin: 0 auto;
  text-align: center;
  font-family: sans-serif;

              var randomQuotes = ["Nothing in the world is more dangerous than sincere ignorance and conscientious stupidity.", "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg", "The power of accurate observation is frequently called cynicism by those who don't have it.", "Everybody pities the weak; jealousy you have to earn.", "I have not failed. I've just found 10,000 ways that won't work."];
var quoteAuthors = ["Martin Luther King Jr.", "Bjarne Stroustrup", "George Bernard Shaw", "Arnold Schwarzenegger", "Thomas Alva Edison"];
var randomQuoteID = 0;
var urlFriendlyQuoteTemp = [];
var urlFriendlyAuthorTemp = [];

    $(this).html("<p>" + randomQuotes[randomQuoteID] + "</p>");
    $(this).append("<h3>-" + quoteAuthors[randomQuoteID] + "</p>");
    urlFriendlyQuoteTemp = randomQuotes[randomQuoteID].split("");
    for (i = 0; i < urlFriendlyQuoteTemp.length; i++) {
      if (urlFriendlyQuoteTemp[i] == " "){
        urlFriendlyQuoteTemp[i] = "%20";
    urlFriendlyAuthorTemp = quoteAuthors[randomQuoteID].split("");
    for (i = 0; i < urlFriendlyAuthorTemp.length; i++){
      if (urlFriendlyAuthorTemp[i] == " "){
        urlFriendlyAuthorTemp[i] = "%20";
    $(this).append("<a class='twitter-share-button' href='" + urlFriendlyAuthorTemp.join('') + "%20said%20that%20" + urlFriendlyQuoteTemp.join('') + "'" + "data-size='large' target='_blank'>Tweet this</a>");
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.