CSS Tooltip

A tooltip is often used to specify extra information about something when the user moves the mouse pointer over an element.

<!DOCTYPE html>
<html lang="en">
<title> CSS Tooltip </title>
<meta charset="UTF-8">
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: green;
color: #fff;
text-align: center;
border-radius: 10px;
padding: 10px 0;
position: absolute;
z-index: 1;
.tooltip:hover .tooltiptext {
visibility: visible;
<body style="text-align:center;">
<p>Move the mouse over the text below:</p>
<div class="tooltip">Hover over me
<span class="tooltiptext">Tooltip text</span>

CSS Tooltip

Move the mouse over the text below:

Hover over me Tooltip text

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Color Picker

List of color names supported by all browser »

Character Code

List of character codes to display special character »

Language Code

List of all language supported by all browser »

Country Code

List of Country code supported by all browser »

Latest Updates

PHP Introduction

How to Run a PHP program in Xampp?

How can I create a phpinfo.php page?

How to Define a Variable in PHP

PHP Echo and Print Statements

Working with PHP Operators

Understanding the PHP Data Types

How to Write Comments in PHP

How to Define a Constant in PHP

PHP if...else...elseif Statements