I am trying to achieve something and cannot do it.
I have a div with a fixed height and width. I want the text to be centered vertically.
so far I have managed to do this:
<div>
<a>this is a long text</a>
</div>
and it will look like this
-------------
This is a long
text
-------------
which is great
But if the line is not completed, it will look like
------------
This is short
-------------
.the-div
{
height:29px;
line-height:14px !important;
}
.the-a
{
font-size:12px;
}
I need this to be appreciated too!
I tried using linear height and playing with JS to figure out if it wraps or not, and then changes the line height accordingly
thanks for the help
source
share