2 replies [Last post]
cjc
Offline
newbie
brisbane
Last seen: 17 years 48 weeks ago
brisbane
Joined: 2005-02-24
Posts: 7
Points: 0

<div class="tnlquicklink"><a href=""><img src="images/tnl-quicklink.gif" alt="image: arrow" width="32" height="30" border="0" /></a><a href="">2005 Teaching and Learning Calendar</a></div>

What is the best way to align text with the middle of an image with CSS?

Anonymous
Anonymous's picture
Guru

Aligning text with image

.tnlquicklink img{
vertical-align: middle;
}

cjc
Offline
newbie
brisbane
Last seen: 17 years 48 weeks ago
brisbane
Joined: 2005-02-24
Posts: 7
Points: 0

Aligning text with image

Thanks for your quick reply.
tried what you wrote.

Works in IE but doesn't seem to quite middle align in Firefox for Windows.
So I have added in:

<a class="tnlqlinktext" href="">2005 Teaching and Learning Calendar</a>

a.tnlqlinktext { vertical-align: middle; }

Don't understand why I need to do this but it seems to work in both browsers now?