Solved

How to center alternate text for an image vertically and horizontally

Posted on 2008-06-26
4
229 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to delete "dots" above Bootstrap 3 navbar 4 66
I want a tab to always be underlined when I open div then change 1 35
Alert after MVC form submitted 1 22
Html Newline 7 21
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

821 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