views:

1104

answers:

2

Is there a way to have ToolTip on web control (ImageButton to be specific) that looks like this in Mozilla Firefox browser:

John Smith Age 24 Gender: male ...

Tried Environment.NewLine, \n, \r\n, @""(with "" string literal spanning over several lines of code). All these things work perfectly in Internet Explorer 7, but in Mozilla all NewLine's and \n's are replaced by whitespaces.

Any workaround for this? And are there other browsers ignoring NewLine's in similar way?

Warning: Mozilla shows example text above ("John Smith" and so on) in one line, like in tooltips I just talked about. So let's repeat what I want to see in tooltip for Mozilla users:

John Smith

Age 24

Gender: male

...

(No blank lines should be shown after each line of data, but Mozilla shows either all data in single line or separated by blank lines - no compromises unfortunately...)

+2  A: 

This might be way more than you need but this jQuery plugin is pretty good in my limited experience with it: http://plugins.jquery.com/project/bt

Jon
+2  A: 

HTML 4.01 6.2 apparently (I don't have it in front of me) says that the title attribute should not contain newlines, and CRs and tabs should be replaced with spaces. Unfortunately Firefox enforces this at display time rather than parse time. HTML 5 however specifies that this is no longer correct behaviour, so maybe Firefox 3.next will get this right.

Neil