-
Notifications
You must be signed in to change notification settings - Fork 0
/
dropmenu_01.html
59 lines (55 loc) · 1.35 KB
/
dropmenu_01.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Drop Menu: Step 1</title>
<link rel="stylesheet" href="css/dropmenu.css">
<style type="text/css">
dl.drop-menu
{
position: absolute;
left: 50%;
margin-top: 30px;
margin-left: -80px;
z-index: 1;
}
</style>
</head>
<body>
<nav>
<dl class="drop-menu">
<dt>Days of the Week</dt>
<dd>Monday</dd>
<dd>Tuesday</dd>
<dd>Wednesday</dd>
<dd>Thursday</dd>
<dd>Friday</dd>
<dd>Saturday</dd>
<dd>Sunday</dd>
</dl>
</nav>
<section>
<p>A CSS Drop Menu.</p>
</section>
<script>
/* DROP-CSS
*
* Maybe the easiest way to hide and show something is to style it hidden and then show it when wanted.
*
* 1. Test this page in a browser and explore how it is built.
* 2. Add the CSS rule to the <head><style> node to hide the <dd> elements in the menu:
*
* dl.drop-menu dd { display: none; }
*
* 3. Showing these elements is then as simple as a new style for whenever the menu is hovered over:
*
* dl.drop-menu:hover dd { display: block; }
*
* 4. Test this in a browser. It seems to work fine, but is not terribly interesting.
* 5. Take a moment to learn about CSS transitions here: http://css-tricks.com/almanac/properties/t/transition/
* 6. How might these be used to animate the menu?
*
*/
</script>
</body>
</html>