Вопрос

I am using css to style the background for a link. I have set the anchor tag display to block and given it a width and height value. However, the link text is not aligned vertically. I tried setting the line height to the height of the tag which works but I'm not sure if this is the correct solution or if it works on all browsers. Thanks in advance for any suggestions.

Нет правильного решения

Другие советы

Yes line-height will work moving the text to background. But there are less knock-on effects to using the background-position property to align the background to the text.

background-position: x y;
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top