Skip to content

Instantly share code, notes, and snippets.

@srobbin srobbin/styles.css
Created Apr 18, 2013

Embed
What would you like to do?
A simple CSS tooltip
section {
font-family: Helvetica, sans-serif;
width: 960px;
margin: 50px auto 0 auto;
}
.tooltip {
display: none;
position: absolute;
background: black;
color: white;
padding: 5px;
}
a {
position: relative;
}
a:hover .tooltip {
display: block;
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tooltip!</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<section class="container">
<h1>A simple tooltip example</h1>
<p>
<a href="#">
Hover me, please.
<span class="tooltip">I'm a tooltip!</span>
</a>
</p>
</section>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.