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


    <button data-target="simpleModal_1" data-toggle="modal">Dismiss modal with a custom button</button>
	<button data-target="simpleModal_2" data-toggle="modal">Dismiss modal with [&times;] button</button>

<div id="simpleModal_1" class="modal">
    <div class="modal-window">
	 <button data-dismiss="modal">Close</button>
        <h3>Dismiss with a custom button</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<div id="simpleModal_2" class="modal">
    <div class="modal-window small">
        <span class="close" data-dismiss="modal">&times;</span>
        <h3>Dismiss with [&times;] button</h3>

        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <button data-dismiss="modal">Close</button>
Updated version:<strong><a target="_top" href=""></a></strong></footer>


                .modal {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: none;
  overflow: auto;
  background-color: #000000;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;

.modal-window {
  position: relative;
  background-color: #ffffff;
  width: 50%;
  margin: 10% auto;
  padding: 20px;

.modal-window.small {
  width: 75%;

.modal-window.large {
  width: 75%;

.close {
  position: absolute;
  top: 0;
  right: 0;
  color: rgba(0, 0, 0, 0.3);
  height: 30px;
  width: 30px;
  font-size: 30px;
  line-height: 30px;
  text-align: center;

.close:focus {
  color: #000000;
  cursor: pointer;

.open {
  display: block;
button {
  padding: 15px;
  font-size: 12px;
  background: indianred;
  color: #fff;
  border: none;
.subheading {
  font-style: italic;

a { 
  font-family: sans-serif;


document.addEventListener('click', function (e) {
    e = e || window.event;
    var target = || e.srcElement;

    if (target.hasAttribute('data-toggle') && target.getAttribute('data-toggle') == 'modal') {
        if (target.hasAttribute('data-target')) {
            var m_ID = target.getAttribute('data-target');

    // Close modal window with 'data-dismiss' attribute or when the backdrop is clicked
    if ((target.hasAttribute('data-dismiss') && target.getAttribute('data-dismiss') == 'modal') || target.classList.contains('modal')) {
        var modal = document.querySelector('[class="modal open"]');
}, false);

document.body.addEventListener('keydown', (e) => {
  if (e.key === 'Escape') {