Web Tooltip “universally accepted” linebreak character?

前端 未结 4 1859
面向向阳花
面向向阳花 2020-12-19 08:26

I use \\n to create a linebreak in web tooltip. This works in IE and in Chrome. But Firefox ignores it.

What will work universally as linebreak character in tooltip?

相关标签:
4条回答
  • 2020-12-19 09:13

    Update: This has been cleared up in HTML5 using the title attribute. Now Firefox 12 supports it. Try this:

    <span title="First line&#10;Second line">Test</span>
    

    Bad news: Firefox does not line break tooltips. This is actually a non-standard html extension, ie a bug in MSIE that may cause problem with certain pages.

    See this bug on the firefox issue tracker.

    0 讨论(0)
  • 2020-12-19 09:27

    Firefox doesn't display multi-lines in tooltips.

    Use tooltip script if you really want to customize it as you expected. http://www.hongkiat.com/blog/tooltips-scripts-50-scripts-with-ajax-javascripts-css-tutorials/

    0 讨论(0)
  • 2020-12-19 09:30

    This works in mail messages %0A See these google results for more information.

    0 讨论(0)
  • 2020-12-19 09:31

    As of Firefox 12 they now support line breaks using the line feed HTML entity: &#10;

    <span title="First line&#10;Second line">Test</span>
    

    This works in IE and is correct according to the HTML5 spec for the title attribute.

    0 讨论(0)
提交回复
热议问题