简体   繁体   中英

Bootstrap Tooltip / Popper placement not working properly

I am using Bootstrap tooltip but for some reason, placement doesn't work properly.

For example, given the below code:

$('#calendar-of-events .calendar-of-events__contents').tooltip({
                    selector: "a.event-tooltip",
                    trigger: 'hover',
                    placement: 'left'
                })

It produces the tooltip below; instead of placing it on the left, it is somehow place on the right. The 'origin' of the tooltip itself seems wrong as well.

在此处输入图片说明

Is there something preventing the tooltip from being calculated on the left? Are there any css stylings I need to be aware of?

A reason that could lead the tool-tip to not be in the correct placement is the space allocated around the div in which you have placed it. Because your tool-tip has a lot of content inside of it, a suggestion to overcome the misplacement of the tool-tip would be to maybe change the font size, or allocate more space to the div in which the tool-tip is being placed.

Similar question, might have the answer you are looking for...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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