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

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

              
                 <section class="service">
      <!-- /.button service__button -->
      <div class="service-block">
        <div class="service-block__card">
          <img src="https://i.ibb.co/5jCBHQY/slide-1.jpg" alt="card" class="card__background">
          <div class="xz">
            <h1 class="service-block__card-title">Монтаж систем 
            отопления</h1>
          <!-- /.service-block__title -->
            <button class="service-block__card-button button">УЗНАТЬ ЦЕНУ</button>
          </div>
          <!-- /.service-block__button button -->
        </div>
        <!-- /.card -->
        <div class="service-block__card">
          <img src="https://i.ibb.co/tpbytBd/slide-2.jpg" alt="card" class="card__background">
          <h1 class="service-block__card-title">Здесь будет короткое описание
            о данной услуге</h1>
          <!-- /.service-block__title -->
          <button class="service-block__card-button button">УЗНАТЬ ЦЕНУ</button>
          <!-- /.service-block__button button -->
        </div>
        <!-- /.card -->
        <div class="service-block__card">
          <img src="https://i.ibb.co/ryBvHPx/slide-3.jpg" alt="card" class="card__background">
          <h1 class="service-block__card-title">Монтаж канализационного
            оборудования</h1>
          <!-- /.service-block__title -->
          <button class="service-block__card-button button">УЗНАТЬ ЦЕНУ</button>
          <!-- /.service-block__button button -->
        </div>
        <!-- /.card -->
        <div class="service-block__card">
          <img src="https://i.ibb.co/5jCBHQY/slide-1.jpg" alt="card" class="card__background">
          <h1 class="service-block__card-title">Монтаж систем 
            отопления</h1>
          <!-- /.service-block__title -->
          <button class="service-block__card-button button">УЗНАТЬ ЦЕНУ</button>
          <!-- /.service-block__button button -->
        </div>
        <!-- /.card -->
        <div class="service-block__card">
          <img src="https://i.ibb.co/tpbytBd/slide-2.jpg" alt="card" class="card__background">
          <h1 class="service-block__card-title">Монтаж сантехнического
            оборудования</h1>
          <!-- /.service-block__title -->
          <button class="service-block__card-button button">УЗНАТЬ ЦЕНУ</button>
          <!-- /.service-block__button button -->
        </div>
        <!-- /.card -->
        <div class="service-block__card">
          <img src="https://i.ibb.co/ryBvHPx/slide-3.jpg" alt="card" class="card__background">
          <h1 class="service-block__card-title">Монтаж канализационного
            оборудования</h1>
          <!-- /.service-block__title -->
          <button class="service-block__card-button button">УЗНАТЬ ЦЕНУ</button>
          <!-- /.service-block__button button -->
        </div>
        <!-- /.card -->
    </div>
      <!-- /.service-block -->
  </section>
  <!-- /.service -->
              
            
!

CSS

              
                .service
  background: #f1f1f1
  max-width: 1200px
  &-block
    display: flex
    flex-wrap: wrap
    &__card 
      position: relative
      display: inline-block
      width: 300px
      height: 200px
      margin-right: 19px
      margin-bottom: 21px
      &:hover
        color: #000
      &-title
        position: absolute
        right: 0
        bottom: 10px
        font-size: 20px
        top: 42%
        left: 56%
        margin-left: -140px
        margin-top: -40px
        line-height: 28px
        color: #f2f2f2
      &-button
        position: absolute
        right: 0
        top: 48%
        left: 53%
        margin-left: -77px
        margin-top: 19px
        color: #000
        background-color: #ffc800
        padding: 8px 14px
  &__button
    margin: -25px 0 80px -30px
    font-size: 35px
  .card
    &__background
      width: 300px
      height: 200px
      transition: 0.2s
      &:hover
        filter: blur(5px)
.xz
  &:hover
    background: #000
              
            
!

JS

              
                const items = document.querySelectorAll('.service-block__card');

[...items].forEach(item => {
  item.querySelector('.service-block__card-button').addEventListener('click', (e) => {
   item.classList.toggle('service-block__card-active');
    e.target.innerText = item.classList.contains('service-block__card-active') ? '300 руб' : 'Узнать цену';
  });
});
              
            
!
999px

Console