-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
44 lines (41 loc) · 1.78 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="device-width" content="width=device-width initial-scale=1">
<title>CSS Tooltips</title>
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="tooltip.css" media="only screen and (min-width: 767px)">
</head>
<body>
<div class="wrap">
<h1>Tooltips with Pure CSS</h1>
<h2>Hover over / Tab to the spans to see the tooltips.</h2>
<div class="example">
<p>No
<span class="tooltip"
tabindex="1"
data-tip="Such as Sass or Less">
stylesheet languages</span> were used in this project.
</p>
<p>Just plain old HTML and CSS. This code is
<span class="tooltip"
tabindex="2"
data-tip="Available on GitHub! at /harrygfox/css-tooltip">
open source</span> - so feel free to rip it off to your heart's content.
</p>
</div>
<div class="github">
<a href="https://github.com/harrygfox/css-tooltip"
target="_blank">
<h3>View Code on GitHub</h3>
</a>
</div>
<div class="explain">
<p>Each span has a custom data attribute. Here it is <span>data-tip</span>. The value of this data attribute is the message of the tooltip using the CSS function <span>attr()</span>.</p>
<p>Each span also has an attribute of <span>tabindex</span> with values incrementing from 1. This allows users without a mouse to view the messages behind the tooltips.</p>
<p>See <span>tooltip.css</span> for a more detailed breakdown.</p>
</div>
</div>
</body>
</html>