skip to Main Content

Many websites have a feature that when some box or image or any element is hovered and place on it for some time just below the cursor a text is shown (describes or tell that what that item is) . how can we make one like that ?

As I am new to web development I do not know whether its related to CSS or not . If yes I want a small explanation and code along demo image (if possible for the output) . Thank you .

2

Answers


  1. I think you are talking about tooltip
    You can do it with the title attribute or build your custom tooltip.
    You can hover over this test button:

    <button title='This is a test button'>Test button</button>
    Login or Signup to reply.
  2. You can ise the css property :before or :after with content. Its called as 0sudo elements to show text on hover.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search