Re: Vertical align in block link?



Le 20.09.2008 04:06, Jonathan N. Little a écrit :
Jim Moe wrote:
On 09/19/08 09:06 am, Patrick wrote:
I'm trying to align a text vertically in a link displayed as a block.
But the text is always at top.
Is there a solution?

There is no general solution for vertically aligning objects.
For special cases where the text is fixed in length two methods are common.
1. Set the line-height to fill the space.
2. Adjust either the top margin or padding.


It would have to be padding if you set the link to display: block, the margin would not be the "clickable" part.

Thanks for the help. I tried to set height: 50%; padding-top: 50%;
It works more or less in Firefox but not Konqueror (block is only half height, text not vertically centered).

Is there really no solution (even not pure CSS, I don't care) working for most browsers?

--
Patrick
.



Relevant Pages

  • Re: Vertical align in block link?
    ... Jim Moe wrote: ... There is no general solution for vertically aligning objects. ... Adjust either the top margin or padding. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Vertical align in block link?
    ... There is no general solution for vertically aligning objects. ... It works more or less in Firefox but not Konqueror (block is only half ... jmm list sohnen-moe com ...
    (comp.infosystems.www.authoring.stylesheets)