通过ASP.NET在Mozilla Firefox多行提示 - 这可能吗? [英] Multiline tooltip via ASP.NET in Mozilla Firefox - is it possible?

查看:82
本文介绍了通过ASP.NET在Mozilla Firefox多行提示 - 这可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有看起来像这样在Mozilla Firefox浏览器的方式有工具提示对Web控件(ImageButton的是具体的):

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

约翰·史密斯
年龄24
性别:男
...

John Smith Age 24 Gender: male ...

试过Environment.NewLine,\\ n \\ r \\ N,@(与字符串跨越code的几行)。所有这些东西在Internet Explorer 7中很好地工作,但在Mozilla所有换行符的和\\ n的由空格代替。

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?

警告:Mozilla的显示一个线以上(约翰·史密斯等)例如文本,就像在提示我刚才讲的。因此,让我们重复一下我想在工具提示中看到Mozilla的用户:

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:

约翰史密斯

24年龄

性别:男性

...

(不空行应显示每行数据后,但Mozilla的显示无论是在一行的所有数据,或空行分开 - 不妥协可惜...)

(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...)

推荐答案

HTML 4.01 6.2明显(我没有它在我面前)说,title属性不应该包含换行符,和CRS和标签应更换用空格。不幸的是火狐强制执行这个在显示时间,而不是解析时间。 HTML 5然而,指定此不再是正确的行为,所以也许火狐3.next会得到这个权利。

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.

这篇关于通过ASP.NET在Mozilla Firefox多行提示 - 这可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆