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.


                <button class="btn open-modal" id="open-modal">Open Modal</button>
<div id="modal" class="modal open">
  <div class="modal-container">
    <div class="modal-content">
      <img src="">
      <h2>Old Technology</h2>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
        aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
      <a href="#!">learn more</a>
    <span id="close-modal" class="close-modal">&times;</span>


                @import url(";700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "PT Sans", sans-serif;
  background-image: linear-gradient(to top, #fbc2eb 0%, #a6c1ee 100%);
img {
  max-width: 100%;

.btn {
  font-family: "PT Sans", sans-serif;
  font-size: 1.2rem;
  padding: 1rem 2.5rem;
  cursor: pointer;
  border: none;
.open-modal {
  background: #fff;
  border-radius: 5px;
  border: 1px solid transparent;
  box-shadow: 0 5px 10px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.2s linear;
.open-modal:hover {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.5);
  border-color: #fff;

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
} {
  display: flex;
.modal-container {
  background-color: #fff;
  width: 90%;
  max-width: 450px;
  position: relative;
} .modal-container {
  animation: move 0.6s ease-out;
@keyframes move {
  from {
    transform: translateY(-50px);
  to {
    transform: translateY(0px);
.modal-content {
.modal-content > *:not(img) {
  padding: 0 1rem;
.modal-content h2 {
  margin: 1.5rem 0 0.6rem 0;
.modal-content p {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
.modal-content a {
  font-size: 0.8rem;
  text-decoration: none;
  padding-bottom: 1rem;
  display: inline-block;
.modal-content a:hover {
  color: salmon;

.close-modal {
  font-size: 3rem;
  position: absolute;
  top: 0;
  right: 0;
  background-color: #fff;
  height: 40px;
  width: 40px;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  transition: color 0.15s linear;
.close-modal:hover {
  color: #f00;



                const btnOpenModal = document.getElementById("open-modal");
const btnCloseModal = document.getElementById("close-modal");
const modalElm = document.getElementById("modal");

btnOpenModal.addEventListener("click", function () {

btnCloseModal.addEventListener("click", function () {