J
J
JastaFly2020-04-14 13:10:03
css
JastaFly, 2020-04-14 13:10:03

Scrolling a big picture?

Good day to all! There is a very long picture, it goes beyond the borders of the block, even the screen. You need to make it so that it can be scrolled, as in the overflow-y: scroll property. Here's a thread that doesn't work:

11
12
13
.project {
  position: absolute;
  height: 1000px;
  z-index: 10;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  overflow-y: scroll;
  &__img {
    object-fit: cover;
  }
}

Plz tell me how to do this?!??

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya Kolin, 2020-04-14
@JastaFly

It would be better to give a link to https://codepen.io/pen/ with your picture and code.

W
wendem, 2020-04-14
@wendem

Set the parent to position relative and scroll the image to absolute and align it in width or height e.g.

J
JastaFly, 2020-04-14
@JastaFly

In short, initially everything did not work because I wrapped the image in a flex container

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question