V
V
Vitaly2020-10-22 11:01:16
css
Vitaly, 2020-10-22 11:01:16

How to hide blocks when the screen width is reduced without js?

Tell me how to hide a block that does not fit, if the screen width decreases, while I could make it hide part of it, but not completely.

<div class="items">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
        <div class="item">5</div>
        <div class="item">6</div>
        <div class="item">7</div>
        <div class="item">8</div>
        <div class="item">9</div>
      </div>


.items {
  display: flex;
  white-space: nowrap;
  overflow: hidden;
}
.item {
  padding: 16px;
  margin-top: 16px;
  border-radius: 10px;
  background-color: #000;
  color: #fff;
  text-align: center;
  min-width: 80px;
  width: 100%;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Zhulin, 2020-10-22
@vitas1693

Media queries based on screen width

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question