-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstar_demo2.html
78 lines (77 loc) · 2.12 KB
/
star_demo2.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
77
78
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css" media="screen">
.star-rating {
font-family: 'FontAwesome';
margin: 50px auto;
}
.star-rating > fieldset {
border: none;
display: inline-block;
}
.star-rating > fieldset:not(:checked) > input {
position: absolute;
top: -9999px;
clip: rect(0, 0, 0, 0);
}
.star-rating > fieldset:not(:checked) > label {
float: right;
width: 1em;
padding: 0 .05em;
overflow: hidden;
white-space: nowrap;
cursor: pointer;
font-size: 200%;
color: #16a085;
}
.star-rating > fieldset:not(:checked) > label:before {
content: '\f006 ';
}
.star-rating > fieldset:not(:checked) > label:hover,
.star-rating > fieldset:not(:checked) > label:hover ~ label {
color: #1abc9c;
text-shadow: 0 0 3px #1abc9c;
}
.star-rating > fieldset:not(:checked) > label:hover:before,
.star-rating > fieldset:not(:checked) > label:hover ~ label:before {
content: '\f005 ';
}
.star-rating > fieldset > input:checked ~ label:before {
content: '\f005 ';
}
.star-rating > fieldset > label:active {
position: relative;
top: 2px;
}
body {
background: #262829;
color: #95a5a6;
font-family: 'Raleway';
text-align: center;
}
body p {
font-size: 1.6em;
margin: auto;
width: 80%;
}
body a {
color: #16a085;
}
</style>
</head>
<body>
<div class="star-rating">
<fieldset>
<input type="radio" id="star5" name="rating" value="5" /><label for="star5" title="Outstanding">5 stars</label>
<input type="radio" id="star4" name="rating" value="4" /><label for="star4" title="Very Good">4 stars</label>
<input type="radio" id="star3" name="rating" value="3" /><label for="star3" title="Good">3 stars</label>
<input type="radio" id="star2" name="rating" value="2" /><label for="star2" title="Poor">2 stars</label>
<input type="radio" id="star1" name="rating" value="1" /><label for="star1" title="Very Poor">1 star</label>
</fieldset>
</div>
<h1>CSS Star Rating</h1>
<p>Simplified version of Lea Verou's <a href="http://lea.verou.me/2011/08/accessible-star-rating-widget-with-pure-css/">accessible star rating widget</a> using FontAwesome to display empty stars</p>
</body>
</html>