views:

817

answers:

3

I am trying to vertically center an anchor within a fieldset using CSS but it always appears to align to bottom. Is there any tricks to this?

A: 

Have you tried specifying a line-height for the text? It should help to align in both Firefox and IE.

Manuel
Yes, I have tried line-height.
Craig
+1  A: 

You are not giving too much detail here. Besides the line-height you might also want to tweak top and bottom padding. It all depends on how much stuff you have inside the fieldset.

allesklar
A: 

Try setting the style vertical-align:middle;

<a href="www.google.com" style="vertical-align:middle;">google</a>

If that doesn't work posting your HTML would be helpful

bochgoch
This will only work on a table cell. Modern browsers will accept display: table-cell; which in conjunction with vert-align will work. Older browsers won't however.
Ross