I want to center an image on top of my background image.
#home is the background image that stretches to the size of the browser
#hometitle is the image i want on top
I would like to center #hometitle on top of my #home background so no matter the size of the browser, it'll be spaced into the center of the background image.
I have tried margin: 0 auto; and then margin-top: 250px; right after, but that just creates a white gap above the entire background image of 250px;
Position: absolute; and top/left don't really help because the position will be static and not be center as you resize the browser.
#home {
height: 1000px;
margin: 0 auto;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
background-image: url("images/bigheader.png");
}
#hometitle {
background-image:url(images/title.png);
height: 260px;
width: 435px;
}
HTML:
<div id="home">
<div id="hometitle">
</div>
</div>