Ronaldo
Ronaldo

Reputation: 367

vertical center align for anchor inline block

How can I align vertically my anchor that is using inline-block? http://jsfiddle.net/XdfCp/11/

If I change to block, the align works well but the anchor element didn't cover all div.

Upvotes: 0

Views: 387

Answers (3)

JoProte
JoProte

Reputation: 57

Use padding-top:50% eg:

#ListaEventosPorMes a{
display: inline-block;
width: 100%;
height: 100%;
color: White;
text-decoration: none;
background-color: #722827;
vertical-align:middle;
**padding-top:50%;**
}

Upvotes: 0

mithilatw
mithilatw

Reputation: 908

try

.dia a{vertical-align: middle}

This should work.. hope this helps

Upvotes: 0

Madara's Ghost
Madara's Ghost

Reputation: 175017

Remove the height: 100% on the link. It will be vertically centered in its container.

Upvotes: 1

Related Questions