473,406 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

image alt style pop up for text

hi,

in html, how do i create a pop up description box for text. i want, in
the same way that when you write the image alt tag and the user rolls
the cursor over the image a pop up box appears, but for text. any
help?

cheers

burnsy
Jul 20 '05 #1
7 13970
bi******@yahoo.co.uk (mr_burns) writes:
in html, how do i create a pop up description box for text. i want, in
the same way that when you write the image alt tag and the user rolls
the cursor over the image a pop up box appears, but for text. any
help?


1) There's no such thing as an alt _tag_. You mean alt attribute.

2) That's not what the alt attribute is for, read
http://ppewww.ph.gla.ac.uk/%7Eflavell/alt/alt-text.html

Mozilla and other recent browsers do not display the alt attribute
when the image is being displayed.

3) You want the title attribute (can be used on images too)
<p title="description"> ... </p>
<img src="logo.jpg" alt="Widget Corp." title="Providing Widgets Worldwide">

--
Chris
Jul 20 '05 #2
mr_burns wrote:
in html, how do i create a pop up description box for text. i want, in
the same way that when you write the image alt tag and the user rolls
the cursor over the image a pop up box appears, but for text. any
help?


<span title="Popup text">blah blah</span>

....or any other element you want. Assign a class to the element, and
style it so that the user knows to mouseover it. See also <abbr> and
<acronym>.

--
Mark.
http://tranchant.plus.com/
Jul 20 '05 #3
On Fri, 6 Aug 2004, Mark Tranchant wrote:
<span title="Popup text">blah blah</span>
Good answer, as far as it goes ;-)
...or any other element you want.
Yes, preferably, *any* other element, if there's an appropriate one.
Keep <span> as the last resort. Don't you agree?
Assign a class to the element, and style it
so that the user knows to mouseover it.
A dotted box seems to be a fairly conventional clue. I'm not sure
I can think of a better one. Cursor=help is no use by itself, if the
user had no motive to go mousing over it anyway - this is supposed to
be information, not a treasure hunt (as I'm sure you'd agree, right?)
See also <abbr> and <acronym>.


Fine things, in theory, yes. But IE refuses to support <abbr>, and
quite what an <acronym> is exactly, has been the topic of numerous
acr..ymonious (sorry!) arguments, unfortunately. (Which I'd rather
not start all over again here, thanks ;-)

But don't forget <dfn title="defining instance">dfn</dfn>

I give you, for instance:

abbr, acronym, dfn, .abbr { border: 1px dotted #666;
background-color: #eee; color: #030;
border-top: none; cursor: help; }

with non-acronym abbreviations done as e.g
<span class=abbr title="Windows Task Force"><abbr
title="Windows Task Force">WTF</abbr></span>
on the days when I'm feeling generous towards IE users.

all the best

(Yes, it -was- meant to be a joke)
Jul 20 '05 #4
On Fri, 6 Aug 2004 16:09:39 +0100, Alan J. Flavell <fl*****@ph.gla.ac.uk>
wrote:
A dotted box seems to be a fairly conventional clue. I'm not sure
I can think of a better one.


I'd use just a dotted underline. Left and right margins on inline elements
get weird when wrapped.
Jul 20 '05 #5
(Discussion started in c.i.w.a.h. under Subject "image alt style pop up
for text", now changed to discussing the use of a title="..." attribute
to create a popup info text, and how to make it obvious to users that
there _is_ some info available.)

Neal <ne*****@yahoo.com> wrote:
On Fri, 6 Aug 2004 16:09:39 +0100, Alan J. Flavell
<fl*****@ph.gla.ac.uk> wrote:
A dotted box seems to be a fairly conventional clue. I'm not sure
I can think of a better one.

I hadn't heard of the convention before, but it sounds reasonable.
I'd use just a dotted underline.
I guess you mean a dotted bottom border. I don't know of any way, in HTML
or CSS as currently specified and generally implemented, to create a
dotted underline proper. But bottom borders can be used to simulate them.
(They are still different beasts. Underlining is at the baseline level,
or just a little lower, whereas bottom border is below the element as a
whole, which means that it's below all descenders.)

But a dotted bottom border is some browsers' default rendering of <abbr>
and <acronym> elements. This may cause confusion: users accustomed to
such rendering might get the correct clue "there's info available, if you
move the pointer over this piece of text" - but perhaps also the
incorrect clue "this is an abbreviation or an acronym". Besides, people
who are _not_ familiar with such rendering might assume that the border
is some variation of _link_ underlining.
Left and right margins on inline
elements get weird when wrapped.


I wonder what you mean by such effects. Rather, the top and bottom border
might be disturbing by making adjacent text less readable and even partly
covering it - or borders for other elements.

But there are other problems. Using just e.g.

..titled { border: dotted black thin; }

(together with class="titled" for each element that has title="..."; yes,
we would like to be able to use just a [title] selector, but let's get
real) would make the text inside virtually hit the left and right border,
so we need some left and right padding. Moreover, the border is often
_too_ noticeable, drawing too much attention. Changing the color to some
shade of grey would help a little, but probably not enough. Making it 1px
instead of thin would appear to be natural, though naturally px values
should be avoided (a 1px border looks ridiculous when the font size is
very large, say 60px). More importantly, IE does not support a 1px dotted
border but makes it dashed. Would this be acceptable?

We might also make the border color different from text color, to avoid
any undesired effect on text legibility (especially when the border
becomes dashed - a dash might look too much like an "i" or "l").

So what I would currenly use is

@media screen {
..titled { border: dotted #090 1px;
padding: 0 0.1em; } }

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #6
(Discussion started in c.i.w.a.h. under Subject "image alt style pop up
for text", now changed to discussing the use of a title="..." attribute
to create a popup info text, and how to make it obvious to users that
there _is_ some info available.)
(Now crossposted, with followups set to c.i.w.a.stylesheets.)

Neal <ne*****@yahoo.com> wrote:
On Fri, 6 Aug 2004 16:09:39 +0100, Alan J. Flavell
<fl*****@ph.gla.ac.uk> wrote:
A dotted box seems to be a fairly conventional clue. I'm not sure
I can think of a better one.

I hadn't heard of the convention before, but it sounds reasonable.
I'd use just a dotted underline.
I guess you mean a dotted bottom border. I don't know of any way, in
HTML or CSS as currently specified and generally implemented, to create
a dotted underline proper. But bottom borders can be used to simulate
them. (They are still different beasts. Underlining is at the baseline
level, or just a little lower, whereas bottom border is below the
element as a whole, which means that it's below all descenders.)

But a dotted bottom border is some browsers' default rendering of
<abbr> and <acronym> elements. This may cause confusion: users
accustomed to such rendering might get the correct clue "there's info
available, if you move the pointer over this piece of text" - but
perhaps also the incorrect clue "this is an abbreviation or an
acronym". Besides, people who are _not_ familiar with such rendering
might assume that the border is some variation of _link_ underlining.
Left and right margins on inline elements get weird when wrapped.


I wonder what you mean by such effects. Rather, the top and bottom
border might be disturbing by making adjacent text less readable and
even partly covering it - or borders for other elements.

But there are other problems. Using just e.g.

..titled { border: dotted black thin; }

(together with class="titled" for each element that has title="...";
yes, we would like to be able to use just a [title] selector, but let's
get real) would make the text inside virtually hit the left and right
border, so we need some left and right padding. Moreover, the border is
often _too_ noticeable, drawing too much attention. Changing the color
to some shade of grey would help a little, but probably not enough.
Making it 1px instead of thin would appear to be natural, though
naturally px values should be avoided (a 1px border looks ridiculous
when the font size is very large, say 60px). More importantly, IE does
not support a 1px dotted border but makes it dashed. Would this be
acceptable?

We might also make the border color different from text color, to avoid
any undesired effect on text legibility (especially when the border
becomes dashed - a dash might look too much like an "i" or "l").

So what I would currenly use is

@media screen {
..titled { border: dotted #090 1px;
padding: 0 0.1em; } }

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #7
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in
news:Xn*****************************@193.229.0.31:
Neal <ne*****@yahoo.com> wrote:
On Fri, 6 Aug 2004 16:09:39 +0100, Alan J. Flavell
<fl*****@ph.gla.ac.uk> wrote:
A dotted box seems to be a fairly conventional clue. I'm not sure
I can think of a better one.


I hadn't heard of the convention before, but it sounds reasonable.
I'd use just a dotted underline.


[...]

But a dotted bottom border is some browsers' default rendering of
<abbr> and <acronym> elements. This may cause confusion: users
accustomed to such rendering might get the correct clue "there's info
available, if you move the pointer over this piece of text" - but
perhaps also the incorrect clue "this is an abbreviation or an
acronym". Besides, people who are _not_ familiar with such rendering
might assume that the border is some variation of _link_ underlining.


Then instead of using a dotted underline, a dashed underline could be
appropriate. People might think, "there is a tooltip," while noticing that
it is different from abbr and acronym styling.
--
In a room with thirty-seven people, never have everybody shake each other's
hand.
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jerry Camel | last post by:
I want to center an image on the screen and have text centered over the image. What's the best way to do this? I've been playing with style tags and I can get the stuff to center automatically...
5
by: SeanT | last post by:
Greetings and salutations! I am having a real issue with the VB.NET TreeView control. I need to display an image (a.k.a. logo, picture, etc) from a file as the treenode object. I can not seem to...
4
by: Samuel R. Neff | last post by:
I have a set of radio buttons in a win form that each have an image and text, like so: O O O O How can I set it up so that the image is left aligned, next to the radio button...
5
by: Socrates | last post by:
I am interested in developing an online utility that will enable users to copy and past any image (or upload any image on the internet) to the online utility, which will then convert the image to...
2
by: Amy | last post by:
<style> div.helpBtn{ font:bold 73% verdana; color:#995F8D; text-align:left; width:79px; height:24px; margin:0px; padding: 5px 0px 0px 27px; background:...
9
by: shapper | last post by:
Hello, What is the best way to place an image and a text side by side using CSS? Basicaly what I am trying to do is to make the image and the text to appear as follows: Image My Text......
7
by: jediknight | last post by:
Does anyone know of any examples of doing LED style text displays? I need to implement a text display which has one line of 20 characters. There was an example on Codeproject but I cannot seem...
1
by: jtmphp | last post by:
I have a site written in PHP and a MySql database. I allow my users to enter in information which includes (uploading an image) and I create a row for each user. I display their row information in...
5
by: Kalpana Durairaj | last post by:
I want to insert my image within search result anchor(say google search results). <a href="http://www.codeproject.com">Code Project <!-- Google search result link--> <img src="myimage.png"...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.