Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to center alternate text for an image vertically and horizontally

Posted on 2008-06-26
4
Medium Priority
?
234 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 1000 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 1000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

886 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