Hi,
I am trying to center a div and link both vertically and horizontally on top of an image and I am having trouble doing so.
This is my HTML:
<div class="row image-header-ae-beauty-row">
<div class="col-4 image-header-ae-beauty ">
<div class="image-header-ae-beauty-link"><a href="#">Lorum Ipsum</a></div>
<img src="/wp-content/uploads/2018/10/medical-aesthetic-beauty-image-1.png" />
</div>
</div>
and this is my CSS:
.image-header-ae-beauty-row{
}
.image-header-ae-beauty{
padding: 0 0 0 0;
margin-left: -15px;
}
.image-header-ae-beauty img{
position: relative
}
.image-header-ae-beauty:first-child{
margin-left: 15px;
}
.image-header-ae-beauty-link{
position: absolute;
z-index: 1;
background: #e1d2d2;
padding: 20px;
background: rgb(218, 193, 188);
background: rgba(218, 193, 188, 0.9);
margin: auto;
top: 50%;
transform: translateY(-50%);
}
.image-header-ae-beauty-link a{
color: rgba(255,255,255,1);
font-size: 12px;
line-height: 20px;
text-decoration: none;
}
.image-header-ae-beauty-link a:hover{
color: #85705e}
Can anyone tell me how I can get the link the the opaque box to be centered both horizontally and vertically?
Thanks