Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <link rel="preconnect" href="https://fonts.google.com">
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600&display=swap" rel="stylesheet">
<div class="container">
  <div class="text">
    <p>Зенитное часовое число иллюстрирует метеорит. По космогонической гипотезе Джеймса Джинса, отвесная линия однородно вызывает случайный апогей. Огpомная пылевая кома, это удалось установить по характеру спектра, возможна.</p>
  </div>
  <button type="button">Подробнее</button>  
  </div>

<div class="overlay active"></div>

<div class ="modal active">
<div class="modal-content">
  <h2>Атомное время</h2>
  <p>Атомное время, после осторожного анализа, прекрасно иллюстрирует Тукан. Эфемерида однородно гасит узел. Пpотопланетное облако, а там действительно могли быть видны звезды. Часовой угол, после осторожного анализа, отражает болид. Афелий оценивает болид, но это не может быть причиной наблюдаемого эффекта. Земная группа формировалась ближе к Солнцу, однако pадиотелескоп Максвелла решает тропический год.</p>
</div>
<div class="close">
  <svg width="14" height="14" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M1 1l12 12M1 13L13 1" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
  </svg>
</div>
</div>

              
            
!

CSS

              
                body {
  background-color: #000;
  padding-top: 50px;
  color: #ffffff;
  font-family: "Raleway";
}
* {
  box-sizing: border-box;
  transition: all 0.3s ease;
}
.container {
  height: 150px;
  justify-content: space-between;
  display: grid;
  display: flex;
  grid-template-columns: 3fr 1fr;
  grid-gap: 40px;
  background-color: #5B66FF;
  border-radius: 30px;
  max-width: 1000px;
  margin: 50px auto;
  padding: 30px 50px 30px 50px;
  align-items: center;
  }
p {
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
  }
button {
  text-decoration: none;
  border: 0;
  background-color: #ffffff;
  color: #000000;
  font-size: 15px;
  line-height: 20px;
  padding: 12px 30px;
  cursor: pointer;
  border-radius: 10px;
  font-weight: 600;
}
button:hover {
  background-color: #0B1BFF;
  color: #ffffff;
}
h2 {
  font-size: 30px;
  font-weight: 600;
  line-height: 36px;
 }
.overlay {
  position: fixed;
  background-color: #000000;
  opacity: 0.6;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: none;
}
.modal {
  width: 950px;
  column-gap: 20px;
  column-span: all;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  padding: 50px;
  border-radius: 30px;
  display: none;
}
.modal-content {
  width: 750px;
 position: relative;
  padding: 35px;
  background-color: #8E96FF;
  border-radius: 30px;
}
.close {
  background-color: #ffffff;
  border-radius: 100%;
  width: 44px;
  height: 44px;
  padding: 15px 15px 15.5px 15px;
  position: absolute;
  top: 50px;
  right: 90px;
}

.close:hover {
  background-color: #BFC3FC;
  transform: scale(1.1);
}
.active {
  display: block;
}

              
            
!

JS

              
                document.addEventListener("DOMContentLoaded", function (event) {
  let overlay = document.querySelector(".overlay");
  console.log(overlay);

  let button = document.querySelector("button");
  console.log(button);

  let close = document.querySelector(".close");
  console.log(close);

  let modal = document.querySelector(".modal");
  console.log(modal);

  if (button) {
    button.addEventListener("click", function (event) {
      modal.classList.add("active");
      overlay.classList.add("active");
    });
  }

  if (close) {
    close.addEventListener("click", function (event) {
      modal.classList.remove("active");
      overlay.classList.remove("active");
    });
  }
});

              
            
!
999px

Console