How to style an anchor tag to look like a button with the same height as the button?

前端 未结 2 1499
南笙
南笙 2020-12-14 07:47

I am working on changing the buttons on my site to be styled by a jquery ui theme. Mostly everything is going good with it.

But there are a few anchor tags that I w

2条回答
  •  心在旅途
    2020-12-14 08:09

    This should do it:

    display: inline-block;
    

    The reason your height isn't working is because the anchor tag marks an inline element. The height property doesn't apply to inline elements, and the vertical margin, border and padding act differently.

    Firefox 2 doesn't support inline-block, if you still need to support it, but you can usually get it to work by adding a rule display:-moz-inline-box before the above line.

    Alternatively, you could try using the line-height property.

提交回复
热议问题