please I want to know if exists a vertical alignment for a ‘a href’.
Having a ‘a href’ as display:block, I have set a height to it. Now the alignment of the text is on top… I want to align the text in the middle of the block.
How can I obtain this?
The vertical-align roperty only applies to inline elements and sets the alignment with other inline elements on a single line. It does not apply to block level elements.
However if you have some text that isn’t going to wrap you can set the line-height to the same as the height and the text will be in the middle of that block box.
Basically uses display:table to get the content vertically centered, and gets it working in earlly IE due to a bug wihch works off a double relative shift (that’s right Paul, I’m using your phrase ;)).
If it’s just a single line of text and you know the height of the anchor you can set a line-height equal to the height you set and it will center (this is only for one line)
mainly I want both a vertical align for a href, and a space where I am able to click the hypertext equal to the height I set for the block…
I hope I have been clear…
I have given you have the code in post #2 which should do what you want. As Eric said if you want them aligned horizontally then float the elements also.
If you want something more complicated than that then Ryan has given you a method for aligning block elements vertically,
see this. I have height for the anchor (so I can click also the space where there isn’t any text…), but I am unable to align the text inside vertically centered.