Skip to content

Instantly share code, notes, and snippets.

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

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">
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css">
<section class="container">
<h1>A simple tooltip example</h1>
<a href="#">
Hover me, please.
<span class="tooltip">I'm a tooltip!</span>
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.