Reputation: 18859
I have an anchor tag with some text:
<a href="">My Link</a>
with this styling so that it will look vertically aligned within a 30px high link:
a
{
width: 90px;
padding: 13px 0 13px 0;
}
The problem is that now there is longer text that doesn't fit in the 90px wide link, so it's causing it to wrap. So the text in the link is pushed down farther, and not vertically aligned within the anchor tag.
Anyone know how I can make sure a link is vertically aligned for text on one or two lines? I don't have the ability to add a class to any links with two lines.
Upvotes: 0
Views: 133
Reputation: 157324
Text doesn't wrap for me
If you want to vertically align any text, the correct way is to use line-height
property
Upvotes: 1