Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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

              
                <div id="mc_embed_signup" class="email-octopus-form-wrapper">
<h2 class="email-octopus-heading" style="display: none;">Subscribe to Brand Style Guides</h2>
<p class="email-octopus-success-message"></p>
<p class="email-octopus-error-message"></p>
<form method="post" action="https://emailoctopus.com/lists/bb3165a3-288a-11e6-8483-02d044452955/members/external-add" class="email-octopus-form">
<div class="mc-field-group">
<input id="mce-EMAIL" placeholder="Your Email" type="email" name="emailAddress" class="email-octopus-email-address" style="background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHklEQVQ4EaVTO26DQBD1ohQWaS2lg9JybZ+AK7hNwx2oIoVf4UPQ0Lj1FdKktevIpel8AKNUkDcWMxpgSaIEaTVv3sx7uztiTdu2s/98DywOw3Dued4Who/M2aIx5lZV1aEsy0+qiwHELyi+Ytl0PQ69SxAxkWIA4RMRTdNsKE59juMcuZd6xIAFeZ6fGCdJ8kY4y7KAuTRNGd7jyEBXsdOPE3a0QGPsniOnnYMO67LgSQN9T41F2QGrQRRFCwyzoIF2qyBuKKbcOgPXdVeY9rMWgNsjf9ccYesJhk3f5dYT1HX9gR0LLQR30TnjkUEcx2uIuS4RnI+aj6sJR0AM8AaumPaM/rRehyWhXqbFAA9kh3/8/NvHxAYGAsZ/il8IalkCLBfNVAAAAABJRU5ErkJggg=="); background-attachment: scroll; background-size: 16px 18px; background-position: 98% 50%; background-repeat: no-repeat;">
</div>
<div class="mc-field-group">
<input id="mce-FNAME" placeholder="First Name" type="text" name="firstName" class="email-octopus-first-name">
</div>
<div class="email-octopus-form-row-hp">
<label>Protecting against bot signups - leave this field blank</label>
<input type="text" name="hpbb3165a3-288a-11e6-8483-02d044452955" autocomplete="off">
</div>
<button class="button" type="submit">Subscribe</button>
</form>
</div>
 
              
            
!

CSS

              
                #mc_embed_signup { border: none; text-align: center; width: 100%; } /* Signup form container */

.mc-field-group { display: inline-block;} /* positions input field horizontally */

#mce-EMAIL, #mce-FNAME { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 1em; border: 2px solid #ABB0B2 ; color: #343434; background-color: #fff; padding: .7em 9em .7em 1em; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; display: inline-block; margin: 0; } /* Input Styles */

.clear { display: inline-block; } /* positions button horizontally in line with input */

.button { font-family: 'Helvetica Neue', Helvetica,  Arial, sans-serif; font-size: 1em; letter-spacing: .03em; color: #fff; background-color: #2386C8 ; padding: .7em 2em; border: 2px solid #2386C8 ; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; display: inline-block; margin: 0; } /* Button Styles */

:-webkit-input-placeholder { color: #ABB0B2 ; } /* WebKit browsers */ 
:-moz-placeholder { color: #ABB0B2 ; } /* Mozilla Firefox 4 to 18 */
::-moz-placeholder { color: #ABB0B2 ; } /* Mozilla Firefox 19+ */
:-ms-input-placeholder { color: #ABB0B2 ; } /* Internet Explorer 10+ */

@media (max-width: 768px) { /* positions input field and button underneath each other with 100% width for tablet and mobile */
  
.mc-field-group { display: block; max-width: 100%; }
#mce-EMAIL,#mce-FNAME { padding: .7em 0 .7em 1em; width: 96%; margin: 0; }
.clear { display: block; width: 100% }
.button { width: 100%; margin: .5em 0 0 0; }
  
}

.email-octopus-form-wrapper h2{ font-size:20px;margin:0 0 25px 0;}.email-octopus-form-row{margin-bottom:15px;}.email-octopus-form-row label{display:block;}.email-octopus-form-row input{width:400px;padding:8px;height:32px;border:1px solid #ccc;}.email-octopus-form-row-subscribe{margin-top:20px;}.email-octopus-form-row-subscribe button{background-color:#e0e0e0;padding:6px 12px;border:0;font-weight:bold;}.email-octopus-form-row-hp{position:absolute;left:-5000px;}.email-octopus-error-message{color:#e74c3c;}.email-octopus-referral{margin-top:20px;}
              
            
!

JS

              
                    var emailOctopus = {
        successMessage: 'Thanks for subscribing!',
        missingEmailAddressMessage: 'Your email address is required.',
        invalidEmailAddressMessage: 'Your email address looks incorrect, please try again.',
        botSubmissionErrorMessage: 'This doesn\'t look like a human submission.',
        invalidParametersErrorMessage: 'This form has missing or invalid fields.',
        unknownErrorMessage: 'Sorry, an unknown error has occurred. Please try again later.',
        isBotPost: function() {
            return $('.email-octopus-form-row-hp input').val();
        },
        basicValidateEmail: function(email) {
            var regex = /\S+@\S+\.\S+/;
            return regex.test(email);
        },
        ajaxSuccess: function() {
            $('.email-octopus-success-message').text(
                emailOctopus.successMessage
            );
            $('.email-octopus-form').hide();
        },
        ajaxError: function(textStatus) {
            var response = $.parseJSON(textStatus.responseText);
            if (response && response.error && response.error.code) {
                switch(response.error.code) {
                    case 'INVALID_PARAMETERS':
                        $('.email-octopus-error-message').text(
                            emailOctopus.invalidParametersErrorMessage
                        );
                        return;
                    case 'BOT_SUBMISSION':
                        $('.email-octopus-error-message').text(
                            emailOctopus.botSubmissionErrorMessage
                        );
                        return;
                }
            }

            $('.email-octopus-error-message').text(
                emailOctopus.unknownErrorMessage
            );
        },
        ajaxSubmit: function() {
            var form = $('.email-octopus-form');
            $.ajax({
                type: form.attr('method'),
                url: form.attr('action'),
                data: form.serialize(),
                success: function() {
                    emailOctopus.ajaxSuccess();
                },
                error: function(textStatus) {
                    emailOctopus.ajaxError(textStatus);
                },
            });
        }
    }

    $(function() {
        $('.email-octopus-form').submit(function(e) {
            $('.email-octopus-error-message').empty();
            var emailAddress = $('.email-octopus-email-address').val();

            if (emailOctopus.isBotPost()) {
                $('.email-octopus-error-message').text(
                    emailOctopus.botSubmissionErrorMessage
                );
            } else if (!$.trim(emailAddress)) {
                $('.email-octopus-error-message').text(
                    emailOctopus.missingEmailAddressMessage
                );
            } else if (!emailOctopus.basicValidateEmail(emailAddress)) {
                $('.email-octopus-error-message').text(
                    emailOctopus.invalidParametersErrorMessage
                );
            } else {
                emailOctopus.ajaxSubmit();
            }

            return false;
        });
    });
              
            
!
999px

Console