0

I created an clickable tooltip that disappears when you click outside the card or in the icon, but when i click to show the tooltip and scroll up or down the page, the tooltip card follows. But i want it to be fixed where i opened it.

.tooltip { margin: 0 0.15rem; display: inline-flex; flex-direction: column; align-items: center; icon { color: blue; font-size: 1.0rem; width: 1.0rem; height: 1.0rem; } } 

I tried position: fixed, but it doesn't work.

Update: the tooltip don't scroll with the page anymore, i used ::ng-deep to access the class and set position: absolute, but its style is wrong.

7
  • Position: fixed means the item is fixed on the viewport. So it should be posited on the viewport. Commented May 6, 2021 at 12:39
  • So it wouldn't solve my problem anyway...the card is ok, but i don't know why it isn't fixed where it should be. Commented May 6, 2021 at 12:53
  • If you want to do it, you have to use JavaScript. Commented May 6, 2021 at 12:58
  • I'm working with Typescript, what do you suggest to create this function? Use scrollTop? Commented May 6, 2021 at 13:09
  • How did you made that tooltip appear? Commented May 6, 2021 at 13:11

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.