I'm currently working on customizing Bootstrap 4 tooltips to display images.
<img src="myimage.png" data-toggle="tooltip" data-html="true" title=\'<img src="myimage.png" class="d-block">\'>
To achieve this, I created a custom CSS code to ensure the tooltip scales properly with the image width.
.tooltip-inner {
max-width: 100%;
}
.tooltip.show {
opacity: 1;
}
.tooltip img {
margin: 5px 0;
background-color: #333;
}
Although this setup works well for images, it unintentionally affects all text tooltips as well. I would like to maintain the original behavior of text tooltips while only applying the custom CSS to images. Is there a way to accomplish this?