Program:
Output:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>CSS Tooltip</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="bootstrap/css/font-awesome.min.css"> <style> body { font-family: Arial, sans-serif; } .tooltip { position: relative; display: inline-block; border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ } .tooltip .tooltip_text { visibility: hidden; width: 120px; background-color: black; color: #fff; text-align: center; padding: 5px 0; border-radius: 6px; /* Position the tooltip text - see examples below! */ position: absolute; z-index: 1; } .tooltip:hover .tooltip_text { visibility: visible; } </style> </head> <body> <div class="tooltip"> <button class="tooltip_btn"><i class="fa fa-spinner fa-spin"></i> Hover Me</button> <p class="tooltip_text">You hover on Me ?</p> </div> </body> </html>
Output: