Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Format href title

Reply
Thread Tools

Format href title

 
 
Brian Cryer
Guest
Posts: n/a
 
      10-05-2005
I want to show extra information about a link and am doing this by placing a
short narrative in the title attribute of an <a href... link. This works
fine in Internet Explorer (and I'm hoping in other browsers - I know I
should have checked but I've not done so yet), IE shows a tool-tip style box
when I hover the mouse over the link. My question is whether it is possible
to apply any formatting to this? what I'm really after is a line break, but
if I put a <br> it comes out as part of the title.

Any ideas would be appreciated. So too would be the knowledge that it can't
be done (if it can't be done).

Thanks in advance.
--
Brian Cryer
www.cryer.co.uk/brian


 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      10-05-2005
Brian Cryer wrote:

[title attribute]

> Any ideas would be appreciated. So too would be the knowledge that it can't
> be done (if it can't be done).


It can't be done. Not reliably.

In any case if the title text is so long as to need line breaks it is no
longer title text but content and should be on the page, not in a title
attribute.

--
Cheers
Richard
 
Reply With Quote
 
 
 
 
Brian Cryer
Guest
Posts: n/a
 
      10-05-2005
"rf" <> wrote in message
news:1bhoj3e5x0hli.nhlueqd0r71h$....
> Brian Cryer wrote:
>
> [title attribute]
>
>> Any ideas would be appreciated. So too would be the knowledge that it
>> can't
>> be done (if it can't be done).

>
> It can't be done. Not reliably.
>
> In any case if the title text is so long as to need line breaks it is no
> longer title text but content and should be on the page, not in a title
> attribute.
>
> --
> Cheers
> Richard


Thanks Richard.

--
Brian Cryer
www.cryer.co.uk/brian


 
Reply With Quote
 
Arne
Guest
Posts: n/a
 
      10-05-2005
Once upon a time *Brian Cryer* wrote:
> I want to show extra information about a link and am doing this by placing a
> short narrative in the title attribute of an <a href... link. This works
> fine in Internet Explorer (and I'm hoping in other browsers - I know I
> should have checked but I've not done so yet), IE shows a tool-tip style box
> when I hover the mouse over the link. My question is whether it is possible
> to apply any formatting to this? what I'm really after is a line break, but
> if I put a <br> it comes out as part of the title.
>
> Any ideas would be appreciated. So too would be the knowledge that it can't
> be done (if it can't be done).


You could try to use the same technic as is used here with pure CSS:
http://www.meyerweb.com/eric/css/edge/popups/demo.html

--
/Arne
Now killing all posts originating at GoogleGroups
Workaround: http://www.safalra.com/special/googlegroupsreply/
-------------------------------------------------------------
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      10-05-2005
Brian Cryer wrote:

> I want to show extra information about a link and am doing this by placing a
> short narrative in the title attribute of an <a href... link. This works
> fine in Internet Explorer (and I'm hoping in other browsers - I know I
> should have checked but I've not done so yet), IE shows a tool-tip style box
> when I hover the mouse over the link. My question is whether it is possible
> to apply any formatting to this? what I'm really after is a line break, but
> if I put a <br> it comes out as part of the title.
>
> Any ideas would be appreciated. So too would be the knowledge that it can't
> be done (if it can't be done).


You cannot format the tooltip created by the title attribute, and if you
get your title text too long some (maybe all) UA's will truncate the text

There are JavaScript tooltips, but of course require JavaScript to be
enabled

You can use CSS

A .tip { display: none; }
A:hover .tip {display: inline; }
..tip DIV {
border: 1px solid black;
color: black;
background-color: #ffd;
font-size: 80%;
width: 15em;
padding: .2em;
}

<a href="#">Lorem ipsum
<span class="tip">
<div>
Lorem ipsum dolor sit amet, consectetuer ...
</div>
</span>
</a>

This will cause your text to reflow, I think I have see some examples
with position : absolute but lining up the div will be tricky...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      10-05-2005

Brian Cryer wrote:
> I want to show extra information about a link and am doing this by placing a
> short narrative in the title attribute of an <a href... link.


Stick it in a <span> instead (inside the <a>...</a>), hide it by
default and use some CSS to make it behave however you want.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      10-05-2005
Jonathan N. Little wrote:

> Brian Cryer wrote:
>
>> I want to show extra information about a link and am doing this by
>> placing a short narrative in the title attribute of an <a href...
>> link. This works fine in Internet Explorer (and I'm hoping in other
>> browsers - I know I should have checked but I've not done so yet), IE
>> shows a tool-tip style box when I hover the mouse over the link. My
>> question is whether it is possible to apply any formatting to this?
>> what I'm really after is a line break, but if I put a <br> it comes
>> out as part of the title.
>>
>> Any ideas would be appreciated. So too would be the knowledge that it
>> can't be done (if it can't be done).

>
>
> You cannot format the tooltip created by the title attribute, and if you
> get your title text too long some (maybe all) UA's will truncate the text
>
> There are JavaScript tooltips, but of course require JavaScript to be
> enabled
>
> You can use CSS
>
> A .tip { display: none; }
> A:hover .tip {display: inline; }
> .tip DIV {
> border: 1px solid black;
> color: black;
> background-color: #ffd;
> font-size: 80%;
> width: 15em;
> padding: .2em;
> }
>
> <a href="#">Lorem ipsum
> <span class="tip">
> <div>
> Lorem ipsum dolor sit amet, consectetuer ...
> </div>
> </span>
> </a>
>
> This will cause your text to reflow, I think I have see some examples
> with position : absolute but lining up the div will be tricky...
>

This might be what you are looking for:

Pure CSS Tooltips
http://psacake.com/web/jl.asp

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      10-05-2005
With neither quill nor qualm, Jonathan N. Little quothed:

> Brian Cryer wrote:
>
> > I want to show extra information about a link and am doing this by placing a
> > short narrative in the title attribute of an <a href... link. This works
> > fine in Internet Explorer (and I'm hoping in other browsers - I know I
> > should have checked but I've not done so yet), IE shows a tool-tip style box
> > when I hover the mouse over the link. My question is whether it is possible
> > to apply any formatting to this? what I'm really after is a line break, but
> > if I put a <br> it comes out as part of the title.
> >
> > Any ideas would be appreciated. So too would be the knowledge that it can't
> > be done (if it can't be done).

>
> You cannot format the tooltip created by the title attribute, and if you
> get your title text too long some (maybe all) UA's will truncate the text
>
> There are JavaScript tooltips, but of course require JavaScript to be
> enabled
>
> You can use CSS
>
> A .tip { display: none; }
> A:hover .tip {display: inline; }
> .tip DIV {
> border: 1px solid black;
> color: black;
> background-color: #ffd;
> font-size: 80%;
> width: 15em;
> padding: .2em;
> }
>
> <a href="#">Lorem ipsum
> <span class="tip">
> <div>
> Lorem ipsum dolor sit amet, consectetuer ...
> </div>
> </span>
> </a>


-A div in a span?

>
> This will cause your text to reflow, I think I have see some examples
> with position : absolute but lining up the div will be tricky...
>
>


--
Neredbojias
Contrary to popular belief, it is believable.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      10-05-2005
Neredbojias wrote:

<snip>
>
> -A div in a span?
>

Yep, should just dump the span, not needed...



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      10-06-2005
With neither quill nor qualm, Jonathan N. Little quothed:

> Neredbojias wrote:
>
> <snip>
> >
> > -A div in a span?
> >

> Yep, should just dump the span, not needed...


Well, if it's any consolation, finding it gave me an almost licentious
thrill.

--
Neredbojias
Contrary to popular belief, it is believable.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BASE HREF and A HREF="#" onclick="..." Vincent van Beveren Javascript 2 07-06-2006 08:33 AM
href="javascript:func()" vs href="#" onclick="javascript:func()" CRON HTML 24 06-20-2006 08:05 PM
onClick method question (this.href and document.location.href) yogesh.bhardwaj@gmail.com Javascript 2 02-03-2005 02:38 PM
difference between location.href and window.location.href? saiho.yuen Javascript 3 09-14-2004 06:51 PM
Problem: Setting MSIE iframe innerHTML change relative href/src to absolute href/src Soren Vejrum Javascript 4 07-05-2003 01:47 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57