Soldato
- Joined
- 18 Oct 2002
- Posts
- 16,030
- Location
- The land of milk & beans
Simple problem, i have a DIV of X by Y, in this div should be an image of A by B which should be aligned centrally horizontally and vertically which also has a link on it.
It'll align horizontally, but not vertically... I've found the reason why (line heights and textual rendering shenanegans) but not found any workaround that work.
here's the code...
Please excuse the bit of a mess the CSS is in, I've been googling the problem and found a hack that didnt work.
Any help appreciated before i scrap the lot and redo it with tables in about half the time this has taken.
It'll align horizontally, but not vertically... I've found the reason why (line heights and textual rendering shenanegans) but not found any workaround that work.
here's the code...
Please excuse the bit of a mess the CSS is in, I've been googling the problem and found a hack that didnt work.
Code:
DIV#thumb_container {
width: 135px;
height: 137px;
border: 1px dotted #999999;
text-align: center;
vertical-align: middle;
line-height: 135px;
}
/* IE HACK */
DIV#thumb_container > A IMG {vertical-align: middle;}
DIV#thumb_container IMG {
border: 1px solid #999999;
}
<div id="thumb_container">
<a href="asset.asp?a=1"><img src="../assets/thumbs/tn.gif" border="0"></a>
</div>