1
I have a page and login to develop and there’s a logo right in the center of the page. Okay, I centered it this way:
bg{
background-image: url("../imagens/bg.jpg");
background-repeat: no-repeat;
background-position: center;
width: 100%;
height: 1138px;
}
.logo {
background-image: url("../imagens/logo.png");
width: 140px;
height: 101px;
margin-left: -70px;
left: 50%;
position: absolute;
}
I put a position:absolute
and I would like to know if there is another way, because otherwise everything that comes under that div .logo
I’ll have to put position and I don’t want that.
HTML:
<div class="bg">
<div class="logo"></div>
</div>
Demonstrative image:
edited the question
– Felipe Viero Goulart
Does none of these techniques (http://answall.com/questions/5225/centralizar-imagem-dentro-de-umadiv) solve the problem?
– Wakim
What I need is a little different this time. I can centralize and work the rest of the site perfectly, only I would prefer not to use
position
, because I have to keep on definingtop
of each element.– Felipe Viero Goulart