Programming Exercises

Design a tooltip with an arrow that dynamically changes position based on hover location.

Hard

Problem Statement

Design a tooltip with an arrow that dynamically changes position based on hover location.

Sample Output

The tooltip appears above, below, left, or right of the button based on the hover position.

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<!DOCTYPE html> <html> <head> <style> /* Add CSS here to style the dynamic tooltip */ </style> </head> <body> <div class="tooltip-container"> <button class="tooltip-button">Hover Me</button> <div class="tooltip">Tooltip Text</div> </div> </body> </html>
Log in or sign up to run or submit your code.Log inSign up
Expected Output
The tooltip appears above, below, left, or right of the button based on the hover position.