Solved

How to center alternate text for an image vertically and horizontally

Posted on 2008-06-26
4
226 Views
Last Modified: 2010-04-09
how do I get the alternate text for this image to center vertically and horizontally? Do I have to place valign="middle" and Div align="center"  and/or class="altMsg" somewhere else in the code?

Thanks!

John




<td valign="middle" width="180" height="140"><div align="center"><a href="http://www.cowboom.com" class="altMsg"><img src="images/BidNowSilver.jpg" alt="Picture not available. Speak to your network administrator about privileges." width="150" height="129" border="0"></a></div></td>
 
 

.altMsg {font-family: "Gill Sans MT"; font-size: 12px; line-height:14px; color:#000000; text-align:center;}

Open in new window

0
Comment
Question by:gabrielPennyback
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 250 total points
ID: 21879349
you cannot control the position of the "tooltip" produced by alt. That decision is made by the browser.
0
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 250 total points
ID: 21880740
hielo is correct.  This location is set in the .EXE code for the browser, so many pixels to the right and either below or above the leading line that the link is coming from.  If you MUST try to position the "tooltips" message that the browser produces onMouseOver, then you will actually have to center the text through either absolute position or table layout so that the TRUE center of the screen is about 10 pixels to the right of the RIGHT side of the link you are hovering over.  About 10 px will put the start of tooltips dead center on the screen.  And this will vary depending on each browser and version, but you can FUDGE it near enough.
0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 21886776
Since my image is already in a table cell, along with other images in other cells, I gues s I can't use scratchyboy's technique. Or can !?

 Either way thanks to both of you.

John
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 21888875
Only if you have the line where you want centered tooltips on its own line, not in a series of columns.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now