简体   繁体   中英

Tooltip cut off because of overflow

I would like to have a tooltip outside a scrolling container (when the tooltip is centered). However the tooltip always cuts off because the scrolling container has an overflow: auto attribute.

在此处输入图片说明

This demo I made demonstrates what my issue is: https://jsfiddle.net/ny610aL1/1/

Because of the tooltip, the position: relative is on the item instead. I think this prevents that i move the container outside with css.

Is there any way that this is possible using CSS?

No, you'll have to put the tooltip container outside the overflow container. These dialog layers usually end-up before the closing tag of body for this very reason => positioning.

Tooltip widgets often come with JavaScript libraries attached (jQuery-UI, Bootstrap, ...).

In a CSS only solution, you'll have to be happy with the fact that positioning is not calculated but anticipated.

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