'remove line break from boostrap tooltip
I have a span tooltip that displays some information like: name and history.
I can separate this information with a <br>
, but the tooltip is performing an automatic line break in the name.
How can I prevent the tooltip from performing this line break and only I, using <br>
, can do this?
Image of the problem with an unwanted line break between "Xavier - Custodio"
Span code:
<span data-type="success" data-toggle="tooltip" data-html="true" data-placement="right" title="<%=txtTitle%>"><%=RsConsulta("servico")%></span>
=txtTitle :
txtTitle = "Released by: Thomas Neo Anderson"
txtTitle = txtTitle & "<br>History: Test for Example"
I'm using ASP Classic for Back-End
Solution 1:[1]
You could add this CSS rule :
.tooltip-inner {
max-width: none !important;
}
$("[data-toggle='tooltip']").tooltip();
.tooltip-inner {
max-width: none !important;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<span data-type="success" data-toggle="tooltip" data-html="true" data-placement="right" title="Line break wherever I want !<br/>Line break wherever I want. Line break wherever I want">test</span>
Solution 2:[2]
Use bootstrap variable $tooltip-max-width: none;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Tom |
Solution 2 | Jo. |