html – 在title属性中添加换行符

前端之家收集整理的这篇文章主要介绍了html – 在title属性中添加换行符前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
参见英文答案 > How can I use a carriage return in a HTML tooltip?24个
我想知道如何在title属性添加一个中断,我想在title属性中有中断来区分名称.
如何在title属性添加中断?

我有类似的东西

<p title="this is a description of the some text <br> and further description">Some Text</p>

出来的是:

解决方法

如果您在想要换行的地方添加新行,则它适用于某些浏览器,但不适用于所有浏览器.

例:

div { background-color: #c3c3c3; display: block; width: 100px; height: 100px; }
<div title="This is a text
    Second line
    Third line!">Contents</div>

的jsfiddle:
http://jsfiddle.net/g5CGh/

原文链接:https://www.f2er.com/html/227545.html

猜你在找的HTML相关文章