如何使用ngx-bootstrap的工具提示清晰显示图像

问题描述 投票:0回答:1

我想用ngx-bootstrap的工具提示显示图像。

问题

  • 工具提示的宽度不足,图像突出。
  • 第一次的显示位置与第二次及以后的显示位置不同。

第一enter image description here

第二enter image description here

有没有改善的方法?

stackblitz

  • Angular CLI:8.3.19
  • 节点:12.12.0
  • OS:darwin x64
  • 角度:8.2.14
  • 引导程序:“ ^ 4.3.1”
  • ngx-bootstrap:“ ^ 5.2.0”
angular ngx-bootstrap
1个回答
0
投票

您可以通过如下设置img标签的宽度来处理它。

<img id="tool-tip" src="https://placehold.jp/200x200.png"/>

#tool-tip {
  width: 180px;
}

因此它始终整齐地位于工具提示中。这是演示-https://stackblitz.com/edit/angular-pazo79

© www.soinside.com 2019 - 2024. All rights reserved.