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


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


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 lang="en">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
<body class='randomBgColor'>
  <div id='quote-box'>
    <div id='text'>
      <i class="fa fa-quote-left randomTxtColor" aria-hidden="true"></i>
      <span id='quoteText'class='randomTxtColor'></span>
      <span id='author' class='randomTxtColor'></span>

    <div id='buttonBox'>
      <a  class="twitter-share-button" id="tweet-quote" target="blank" href="" data-text="custom share text"><i class="fa fa-twitter randomBgColor" aria-hidden="true"></i></a>
      <button id='new-quote' class="randomBgColor">New Quote </button>

  </div> <!--quotebox end -->
  <span id='credit'>by <a target='blank' href=''>Alberto Montalesi </a></span>




                @import url(',700');

body {
  font-family: 'Lato', sans-serif;
  background-color: #3498db;

* {
  margin: 0;
  padding: 0;
.randomBgColor {
    transition: background-color 1s ease;

.randomTxtColor {
  transition: color 1s ease;
#quote-box {
  width: 400px;
  min-height: 200px;
  height: auto;
  margin: 10% auto 0 auto;
  background-color: white;
  padding: 10px;
  border-radius: 5%;
#text {
  padding: 25px;

.fa-quote-left {
  font-size: 55px;
  padding-right: 15px;
  display: inline-block;
  width: auto;
#quoteText {
  font-size: 25px;
  text-align: center;
  width: 70%;

#author {
  font-size: 16px;
  text-align: right;
  display: block;
  width: 100%;
#buttonBox {
  padding: 15px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-content: center;
.fa-twitter {
  font-size: 40px;
  padding:5px 5px 0 5px;
  color: white;

#new-quote {
  padding:0 10px;
  cursor: pointer;
  color: white;
  font-weight: bold;

#new-quote:hover {
  opacity: 0.5;
.fa-twitter, #new-quote {
  border-radius: 20%;
  border: none;

#credit {
  display: block;
  margin: 0 auto;
  width: 150px;
  height: 15px;
  color: white;
#credit a, #credit a:hover {
  color: inherit;
  text-decoration: none;



                // DOES NOT WORK WITH HTTPS//


  getQuote(); /*to already have a quote when i load the page*/
  colorRandomizer(); //to create a random color as soon as i load
  function getQuote(){
      var url="";

        //store the quote and the author in var
        var currentQuote = data.quoteText;
        var currentAuthor = data.quoteAuthor;
        //add them to my html
        $("#author").html("- " + currentAuthor);

        //prepopulate my twitter
        $('#twitter').attr('href', ',Fcc&related=freecodecamp&text=' + encodeURIComponent('"' + currentQuote + '" ' + currentAuthor));
      });/*end get json*/

  }; /*get quote end */

    //run my color randomizer and my get quote
    getQuote(); /* to generate a quote */

  function colorRandomizer(){
    var myColors=["#3498db","#2ecc71","#9b59b6","#e74c3c","#f1c40f"]; //array of colors
    var randomNum= Math.floor((Math.random()*myColors.length)); //generate random number

    var randomColor= myColors[randomNum]; //store my random color
    //modify bg and txt color with my random color
    $(".randomTxtColor").css("color", randomColor);

});/* end jquery*/