简体   繁体   English

在我的工具提示中打断

[英]To break line in my tooltip

I am using codeigniter and here I am fetching record in my tooltip. 我正在使用codeigniter,在这里我在工具提示中获取记录。 But problem is that, if I want multiple name in my tooltip, it doesn't go to new line as I have tried so many times like, &#013; 但是问题是,如果我想在工具提示中使用多个名称,它不会转到新行,因为我已经尝试了很多次,例如&#013; , <br> , or something like javascript. <br>或类似javascript的内容。 But nothing is working. 但是没有任何效果。 I want suggestion for that. 我想要这个建议。 Here is my code: 这是我的代码:

<td><a href="#" class="my_tooltip" data-toggle="tooltip" title="<?php echo nl2br("$row->active_subject; \n$row->active_note"); ?>"><?php echo $row->active_subject; ?></a></td>

将此添加到您想换行的任何地方&#013;

You can use white-space:pre-wrap on the tooltip. 您可以在工具提示上使用white-space:pre-wrap。 This will make the tooltip respect new lines. 这将使工具提示尊重新行。 Lines will still wrap if they are longer than the default max-width of the container. 如果行比容器的默认最大宽度还长,行仍然会换行。

.my_tooltip {

        white-space:pre-wrap;
    }

If you want to prevent text from wrapping, do the following instead. 如果要防止文本换行,请执行以下操作。

.my_tooltip {
    white-space:pre;
    max-width:none;
}

Try this: 尝试这个:

<td><a href="#" class="my_tooltip" data-toggle="tooltip" title="<?php echo nl2br('$row->active_subject; \n$row->active_note'); ?>"><?php echo $row->active_subject; ?></a></td>

Remove " " with ' ' in title. 删除标题中带有“”的“”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM