Here's the HTML code I'm struggling with, which is inside an ASP.NET Repeater:
<div class="team_member">
<a class="teamMemberLink" href='<%# "Profile.aspx?uID=" + Eval("ID") %>' target="_blank"><%# Eval("Name")%></a>
<asp:Image ID="teamMemberProfileImage" CssClass="teamMemberImg" runat="server" ImageUrl='<%# "ImageHandler.ashx?id=" + Eval("ID") %>' />
<input id="rateTeamMember" class="teamMemberRating" type="button" value="" runat="server" />
<input id="teamMemberID" type="hidden" value='<%# Eval("ID") %>' />
</div>
I'm facing a challenge where I need the anchor text to be positioned directly above the image and centered, but since the text length varies, I'm unsure how to achieve this with an image width of 96px.
Is there a way to determine the pixel width of the anchor text so it can be accurately positioned using jQuery (with 'position:relative' and setting the 'left' property)?
Additional information - here's my existing CSS code:
.team_member { float: left; margin-left: 10%; margin-top: 10%; text-align:center; }
.teamMemberLink { float: left; clear: left; position: relative; top: -20px; }
.teamMemberImg { width: 96px; height: 96px; float: left; border: 1px solid #d1c7ac; }
.teamMemberRating { float: left; }
Any assistance would be greatly appreciated :)