# Ionic 4 : Scroll with max-height

**URL:** <https://forum.ionicframework.com/t/ionic-4-scroll-with-max-height/163116>\
**Category:** Ionic Framework\
**Created:** [May 5, 2019, 2:03pm UTC](https://forum.ionicframework.com/t/ionic-4-scroll-with-max-height/163116 "2019-05-05T14:03:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pred449](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@pred449](https://forum.ionicframework.com/u/pred449)\
**Post date:** [May 5, 2019, 2:03pm UTC](https://forum.ionicframework.com/t/ionic-4-scroll-with-max-height/163116/1 "2019-05-05T14:03:34Z")

</div>

I’m getting an issue with scroll in ionic 4 and angular 7.

I have the following structure:

```auto
<ion-grid>
    <ion-row>
      <ion-col>
       <ion-card>
        <ion-card-header>
         <!-- some content -->
        </ion-card-header>
        <ion-card-content>
         <ion-list>
          <!-- some ion-item -->
         </ion-list>
        </ion-card-content>
       </ion-card>
      </ion-col>

      <ion-col>
      </ion-col>
    </ion-row>
</ion-grid>

```

I apply a scroll on my ion-card-content with this following scss code :

```auto
ion-card-content {
  max-height: calc(100% - #{50px});
  position: relative;
  overflow: hidden;
  overflow-y: auto;
  ::-webkit-scrollbar {
    display: none;
  }
}

```

If I apply the following scss code on my ion-card the scroll will not work:

```auto
ion-card {
  max-height: 100%;
}

```

If I apply the following scss code on my ion-card the scroll works but the size of ion-card is still the same, and when I have no ion-item in my ion-list it takes all the screen :

```auto
ion-card {
  height: 100%;
}

```

Do you know any way to perform the scroll and keep an height that will size according to the ion-list size ?

(sorry for my english)

---

<div class="post-metadata">

**Author:** ![pred449](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@pred449](https://forum.ionicframework.com/u/pred449)\
**Post date:** [May 14, 2019, 1:22pm UTC](https://forum.ionicframework.com/t/ionic-4-scroll-with-max-height/163116/2 "2019-05-14T13:22:31Z")

</div>

0

I solved the problem by setting the following css code on my ion-card :

```auto
ion-card {
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

```

I also removed the ion-card-content element, and apply the following css code on the ion-list :

```auto
ion-list {
  overflow: hidden;
  overflow-y: auto;
  ::-webkit-scrollbar {
    display: none;
  }
}

```
