0

I have segments and into segments in the body class This should be overflow auto but it is not working. I don't want the head class to scroll just the class body.

Here is the code

.vp-segment {
    background-color: white;
    border: 1px solid #e2e2e2;
    border-radius: 5px;
    padding: 5px;
    margin: 4px 2px;
    max-height: 100%;
  }

.body {
  background-color: #f3f3f3;
  padding: 12px 7px;
  max-height: 99%;
}
 <div class="vp-segment">
              <div class="head">
                <div class="name">
                  <div>Segment</div>
                </div>
                <div class="counters">
                  <span class="sum">∑</span>
                  <span class="amount">
                    <div class="big-digits">
                      <span matTooltip="{{formatedTotalPlannedProject()}}" matTooltipPosition="below">{{formatedTotalPlannedProject()}} EUR</span>
                    </div>
                  </span>
                </div>
              </div>
              <div class="body" style="overflow: auto;">
         </div>
      </div>
Mehraj Khan
  • 927
  • 6
  • 17
  • Same as height in percent, max-height in percent can only work if the parent has a dedicated height to begin with. – CBroe Apr 06 '18 at 10:54
  • I try max-height you can see in the code but it is not working, would you help me ? –  Apr 06 '18 at 10:56
  • I just explained to you what the most common reason/mistake is in that regard. Just responding by repeating information we already have is not helpful. Please go read [mcve], and then edit your question accordingly. – CBroe Apr 06 '18 at 10:58
  • You cannot do a `max-height` on the `body`, as it is a main container, basically the viewport, and since the viewport resize would be a resize, this wont work. Use a wrapper element with that `max-height` and `overflow` property and give the `body` a `height` of `100%`. – somethinghere Apr 06 '18 at 10:58
  • @AZH maybe try and explain a bit more what are you trying to achieve visually. It's not exactly clear what you're asking – Thatkookooguy Apr 06 '18 at 11:01
  • Thank you users I fixed this. –  Apr 06 '18 at 11:12

0 Answers0