Make div fill height but not extend it (use scrollbar for overflow)

Make div fill height but not extend it (use scrollbar for overflow)

I have a specific layout that I want to achieve on my web page, namely:&nbsp;<a href="https://i.imgur.com/bx7iWBC.png" target="_blank"><img src="https://i.imgur.com/bx7iWBC.png"></a>

I have a specific layout that I want to achieve on my web page, namely: 

The layout in the above image is built with the following HTML and bootstrap classes:

        <div className="ContentWrapper d-flex mh-100 flex-row h-100">
            <div className="ContentBody flex-column flex-fill">
                <div className="ContentHeader p-3 w-100">
                    <h2>Header</h2>
                </div>
                <div className="ContentMain w-100">
                    <h2>Scrollable div, should fill height, but not more than that</h2>
                </div>
            </div>
            <div className="Sidebar h-100">
                <h2>Sidebar content</h2>
            </div>
        </div>

Relevant CSS:

.ContentWrapper {
    background-color: red;
}

.ContentBody { background-color: blue; }

.ContentHeader { background-color: yellow; }

.ContentMain { background-color: purple; flex: 1; }

.Sidebar { background-color: green; width: 500px; }

However, when there is too much content in the purple part, the component starts to increase in height. I wish to prevent that and have a scrollbar in the purple component.

Furthermore, I heard that some flex properties work different in Chrome and Firefox. The idea is that I want my web page to have the same behavior in both browsers.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Build Responsive website with HTML CSS Bootstrap 4 and JavaScript [2020]

Welcome, to the best video on complete HTML and CSS Course with one Project in one video in 2020. In this HTML CSS tutorial for beginners, you'll learn the fundamentals of web development(HTML and CSS), along with best practices and professional problem-solving techniques using Developer Tools. Now, What is HTML & CSS 2020?

Build a Register & Login Form using PHP, HTML, CSS, Bootstrap and MySQL

In this tutorial you will learn and build a Responsive PHP Registration & Login Form using PHP, HTML, CSS, Bootstrap and MySQL

How To Make ECommerce Website Using HTML CSS And Bootstrap Step By Step

In this eCommerce website development course you will learn to make an eCommerce website template from with HTML And CSS from beginning to end, step by step with explanation.