0
how do I make the image and link below align to the center vertically?
The image and the online link, and this line, aligned vertically to the center (Middle) in relation to the div login
I tried two ways:
1)
.login {
display: block;
width: 100%;
height:50px;
border:#E9E9E9 3px solid;
position:relative;
}
.login img, .login a {
display:inline-block;
vertical-align:middle;
}
</style>
<div class="login">
<img src="_img/_iconesLoja/email.png" /> <a href="minhaConta.php">Minha Conta</a>
</div>
2)
<style>
.login {
display: block;
width: 100%;
height:50px;
border:#E9E9E9 3px solid;
position:relative;
}
.login .lg {
display: block;
vertical-align:middle;
height:30px;
}
.login .lg img, .login .lg a {
display:inline-block;
vertical-align:middle;
}
</style>
<div class="login">
<div class="lg">
<img src="_img/_iconesLoja/email.png" /> <a href="minhaConta.php">Minha Conta</a>
</div>
</div>
Neither of them worked out?
The alignment I need is vertical
– Carlos Rocha
Do you say the image on top of the link as in the answer above or so but in the vertical center of the div ? @Carlosrocha
– MagicHat
image and link side by side, and centered vertically to the Middle so that the link is not on top of the image. And, this block that contains the image and the link aligned vertically to the Middle in relation to the div login
– Carlos Rocha
Ve-lá man @Carlosrocha edited...
– MagicHat
that’s right, you can only take the text-align: center because I won’t use it!
– Carlos Rocha