Solved

How to center alternate text for an image vertically and horizontally

Posted on 2008-06-26
4
224 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Only if you have the line where you want centered tooltips on its own line, not in a series of columns.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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 code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

771 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

12 Experts available now in Live!

Get 1:1 Help Now