-
Notifications
You must be signed in to change notification settings - Fork 26.9k
/
box-shadow.html
76 lines (64 loc) · 1.91 KB
/
box-shadow.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>CSS box shadow examples</title>
<style>
html {
font-family: sans-serif;
}
p {
margin: 0;
}
article {
max-width: 500px;
padding: 10px;
background-color: red;
background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.25));
}
.simple {
box-shadow: 5px 5px 5px rgba(0,0,0,0.7);
}
.multiple {
box-shadow: 1px 1px 1px black,
2px 2px 1px black,
3px 3px 1px red,
4px 4px 1px red,
5px 5px 1px black,
6px 6px 1px black;
}
button {
width: 150px;
font-size: 1.1rem;
line-height: 2;
border-radius: 10px;
border: none;
background-image: linear-gradient(to bottom right, #777, #ddd);
box-shadow: 1px 1px 1px black,
inset 2px 3px 5px rgba(0,0,0,0.3),
inset -2px -3px 5px rgba(255,255,255,0.5);
}
button:focus, button:hover {
background-image: linear-gradient(to bottom right, #888, #eee);
}
button:active {
box-shadow: inset 2px 2px 1px black,
inset 2px 3px 5px rgba(0,0,0,0.3),
inset -2px -3px 5px rgba(255,255,255,0.5);
}
</style>
</head>
<body>
<h2 id="basic">Basic box shadow example</h2>
<article class="simple">
<p><strong>Warning</strong>: The thermostat on the cosmic transcender has reached a critical level.</p>
</article>
<h2 id="multiple">Multiple box shadows example</h2>
<article class="multiple">
<p><strong>Warning</strong>: The thermostat on the cosmic transcender has reached a critical level.</p>
</article>
<h2 id="inner">Inner shadows example</h2>
<button>Press me!</button>
</body>
</html>