How to auto adjust the div height according to content in it?

Let’s consider you have multiple <div> elements in a row and you want to create a effect where these elements auto adjust based on the content in them.  which needs to be auto adjusted according to the content in it.

In order to achieve this, you need to set height of the div container in css as below:

.fit-content-box {
	background-color: rgb(55,65,72,1);
	color: #FFFFFF;
	padding: 1rem;
	height: fit-content;