I've been trying to center a red block both horizontally and vertically like shown in the picture below, but it's not positioned correctly. I'm using Bootstrap 4. Can anyone point out what's wrong?
https://i.sstatic.net/3ZGg6.png
.parent {
position: relative;
}
.child {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<div class="container-fluid">
<div class="row header-layout">
*Some content*
</div>
<div class="row content-layout">
<div class="col-6 left-side">
*Some content*
</div>
<div class="col-6 right-side">
<div class="row right-title">
*Some Text*
</div>
<div class="row parent">
<div class="child">
*Some content*
</div>
</div>
</div>
</div>
</div>