Hi,
I have two divs that are taking the full width of the browser and what I want to do is place a div with my logo right on the center of the screen on the x direction but basically on top of the two divs.
This is what I currently have which kind of works but the div is not completely on the center, I think I would need to subtract half of the width of the center-div in order for it to be on the center but I don’t know how to do that.
See the Pen Jntso by Filemon Salas (@fs_tigre) on CodePen.
HTML:
<div class ="full">Full Width Div1</div>
<div class ="full">Full Width Div 2</div>
<div class ="logo">Logo</div>
CSS:
body{
color: #fff;
}
.full{
background-color: gray;
height: 100px;
margin-bottom: 10px;
}
.logo{
position: absolute;
left: 50%;
top: 50px;
background-color: black;
width: 100px;
height: 100px;
}
Any idea how can this be accomplished?
Thanks a lot