10

I want to add a line break inside my tool tip but it's not working, i tried everything from \n, <br>, &013;/ &#13

Here is my code:

<a>
 <img class="rounded-circle d-inline-block" src="{{content.image}}"  
 triggers="click" [autoClose]="true" ngbTooltip="{{content.email}} <br> 
 {{content.tel}}">
</a>
Mario Petrovic
  • 7,500
  • 14
  • 42
  • 62
bxxb
  • 740
  • 1
  • 9
  • 20
  • Possible duplicate of [Add line break within tooltips](https://stackoverflow.com/questions/3340802/add-line-break-within-tooltips) – imran ali Jul 24 '19 at 11:21

1 Answers1

16

You could use ng-template here and it would look like below. This should give you the list effect you are looking for. This is what I opted for and worked well.

Angular docs

<ng-template #list>
    <div class="d-flex flex-column">
      <span>{{ content.email}}</span>
      <span>{{ content.tel}}</span>
    </div>
</ng-template>


 <img class="rounded-circle d-inline-block" src="{{content.image}}"  
 triggers="click" [autoClose]="true" [ngbTooltip]="list">

Normal css for class="d-flex flex-column" outside of bootstrap would be

.example {
    display: flex;
    flex-direction: column;
}

explanation found here for flex css

devDan
  • 5,969
  • 3
  • 21
  • 40