#outer {height: 400px; overflow: hidden; position: relative;}#outer[id] {display: table; position: static;}
#middle {position: absolute; top: 50%;} /* For explorer only*/#middle[id] {display: table-cell; vertical-align: middle; width: 100%;}
#inner {position: relative; top: -50%} /* For explorer only *//* Optional: #inner[id] {position: static;} */
<div id="outer"><div id="middle"><div id="inner">any textany heightany content, for example generated from DBeverything is vertically centered</div></div></div>
.circle {/* Act as a table so we can center vertically its child */display: table;/* Set dimensions */height: 200px;width: 200px;/* Horizontal center text */text-align: center;/* Create a red circle */border-radius: 100%;background: red;}
.content {/* Act as a table cell */display: table-cell;/* And now we can vertically center! */vertical-align: middle;/* Some basic markup */font-size: 30px;font-weight: bold;color: white;}
.container {height: 180px;width:100%;background-color: blueviolet;}
.container > div {background-color: white;padding: 1rem;}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"rel="stylesheet"/>
<div class="d-flex align-items-center justify-content-center container"><div>I am in Center</div></div>