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.


                <!DOCTYPE html>
<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">
    <title>Random Quotes App</title>
    <link rel="stylesheet" href="" integrity="sha384-G0fIWCsCzJIMAVNQPfjH08cyYaUtMwjJwqiRKxxE/rx96Uroj1BtIQ6MLJuheaO9" crossorigin="anonymous">
    <link rel="stylesheet" href="style.css">
    <h2>Random Quote Generator</h2>

<section class="hero">
    <div class="backgroudn-image" style="backgroudn-image: url(">
    <div class="hero-content-area">
        <h3 id="quote">Quote goes here!</h3>
        <h3 id="author">Author's name</h3>
    <div class="buttons">
       <a href="#" class="btn" id="getquote"><i class="far fa-hand-point-up fa-3x"></i>New Quote</a>
        <a href="#" class="btn" id="shareQuote"><i class="fab fa-twitter fa-3x"></i>share</a>


 <!-- jQuery 3.3.1.js CDN -->
    <script type="text/javascript" src="main.js">



                /* General Styles */
@import url('');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

html {
    font: normal 16px sans-serif;
    color: #555;

a.btn {
    background-color: #778899;
    border-radius: 20px;
    box-shadow: 0 6px #2F4F4F;

    color: white;
    display: block;
    flex-grow: 1;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    opacity: 1;
    padding: 25px 80px;
    position: relative;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;


a.btn:hover {
    box-shadow: 0 4px #2F4F4F;
    top: 2px;
a.btn:active {
    box-shadow: 0 0 #2F4F4F;
    top: 6px;

body {
    background-image: url(;

section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 80px;

/* Header Styles */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 35px 100px 0;
    animation: 1s fadein 0.5s forwards;
    opacity: 0;

@keyframes fadein {
    100% {
        opacity: 1;

header h2 {
    font-family: 'Montserrat', sans-serif;
    color: white;


/* Hero Styles */

.hero {
    position: relative;
    justify-content: center;
    text-align: center;
    min-height: 50vh;
    border-radius: 3px;

.hero .backgroudn-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    z-index: -1;


.hero h3 {
    font: normal 20px 'Montserrat', sans-serif;

    padding-bottom:  40px;
    background-color: pink;
    padding: 20px;
    border-radius: 3px;



    display: flex;
    flex-direction: row;
    flex-grow: 1;

.hero-content-area {
    min-width: 400px;
    max-width: 550px;
    height: 400px;
    overflow-y: auto;



                $(document).ready(function() {
    var quote;
    var author;
    function getNewQuote() {
            url: "",
            jsonp: 'jsonp',
            dataType: 'jsonp',
            data: {
                method: 'getQuote',
                lang: 'en',
                format: 'jsonp'
            success: function(response) {
                quote = response.quoteText;
                author = response.quoteAuthor;

               $("#quote").html("\"" + quote + "\"")
                if (author) {
                    $("#author").text("--  " + author +  "  --");
                } else {
                    $("#author").text("Unknown Author");

    $("#getquote").on('click', function(){

    $("#shareQuote").on('click', function (event) {'' + encodeURIComponent(quote + ' -- ' + author));