Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

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


Auto Save

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.


                <a href="#" class='notify'>Success!</a>

<a href="#" class='notify error'>Error :(</a>


                body {
    font-family: sans-serif;
.notify {
    display: block;
    text-decoration: none;
    margin: 40px 0;
    color: #00A300;
    text-align: center;
.notify.error {
    color: #8F0000;
.notification {
    position: fixed;
    bottom: 0px;
    right: 50px;
    text-align: center;
    color: #fff;
    opacity: 0.7;
    width: 280px;
    height: 0;
    overflow: hidden;
    -webkit-transition: all ease 0.4s;
    -moz-transition: all ease 0.4s;
    -ms-transition: all ease 0.4s;
    -o-transition: all ease 0.4s;
    transition: all ease 0.4s;
} {
    height: 150px;
.notification:hover {
    opacity: 1;
.notification.success {
    background: #00A300;
.notification.error {
    background: #8F0000;
.notification .close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #fff;
    text-decoration: none;
.notification h5 {
    margin: 35px 0;
    font-size: 20px;
.notification p {
    margin: 20px 0;
    font-size: 12px;


                // Notify.js
// lightweight notification/alert system
var Notify = {
    container: null,
    title: null,
    message: null,
    close: null,
    page: $('body'),
    isClosedByUser: false,
    showTime: 3000, // determines how long notification should be visible for
    showTimer: null,

    showTimeout: function () {
        return setTimeout(function () {
        }, _n.showTime);

    init: function () {'<div class=notification><h5></h5><p></p> <a class="close" href="#">&times;</a></div>');
        _n.container = $('.notification');
        _n.title = _n.container.find('h5');
        _n.message = _n.container.find('p');
        _n.close = _n.container.find('.close');

        // when you hover over the notification, clear the timeout,
        // then set it again when they mouse out


    events: {
        show: function (success, title, message) {

            if (_n.showTimer != null) {
            _n.isClosedByUser = true;
            if (success) {
            } else {

            //hide after Notify.showTime seconds
            _n.showTimer = _n.showTimeout();

        hide: function (e) {
            // check if the user clicked the close button
            if (typeof e != 'undefined') {
                isClosedByUser = true;
            } else {
                isClosedByUser = false;


        hoverStart: function () {

        hoverFinish: function () {
            // if the user clicked the close button
            // then we don't restart the timer
            if (!isClosedByUser) {
                _n.showTimer = _n.showTimeout();

_n = Notify,
    $notify = $('.notify');


$notify.on('click', function (e) {
    if ($(this).hasClass('error')) {, 'Uh oh', 'This is an error D:');
    } else {, 'Success!', 'Something went right :D');