This repository was archived by the owner on Jul 22, 2024. It is now read-only.
forked from rafaelp/css_browser_selector
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
105 lines (93 loc) · 3.44 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Browser Selector Test</title>
<style>
body {
background: rgb(220,220,220);
font: normal normal 1em/1.2em Helvetica,Arial,sans-serif;
}
.wrap {
max-width: 960px;
margin: 0 auto;
padding: 15px;
background: rgb(250,250,250);
}
li.ie, .ie .detected { background-color: yellow; }
li.ie6, .ie6 .detected { background-color: #8a6200 }
li.ie7, .ie7 .detected { background-color: #9c6d00 }
li.ie8, .ie8 .detected { background-color: #b78100 }
li.ie9, .ie9 .detected { background-color: #c68800 }
li.ie10, .ie10 .detected { background-color: #dd9e00 }
li.ie11, .ie11 .detected { background-color: #ffb935 }
li.gecko, .gecko .detected { background-color: #929292; }
li.win.gecko, .win.gecko .detected { background-color: #ff3b49; }
li.linux, .linux.gecko .detected { background-color: pink; }
li.opera, .opera .detected { background-color: #28a324; }
li.konqueror, .konqueror .detected { background-color: #5760ff; }
li.webkit, .webkit .detected { background-color: rgb(149, 61, 245); }
li.chrome, .chrome .detected { background-color: #74ffbe; }
.detected {
display: inline-block;
padding: 2px 10px;
font-size: 80%;
}
.legend {
display: inline-block;
padding-left: 20px;
list-style: none;
}
.legend li {
padding: 2px 10px;
}
</style>
</head>
<body>
<div class="wrap">
<h1>Information on this browser</h1>
<div style="padding-left: 20px;"><p class="detected">USER AGENT STRING:<br /><span id="UserAgent"></span></p></div>
<div>
<ul class="legend">
<li style="border-bottom: 1px solid black;"><strong>Legend</strong></li>
<li class="ie">IE</li>
<li class="ie6">IE6</li>
<li class="ie7">IE7</li>
<li class="ie8">IE8</li>
<li class="ie9">IE9 (Max for WinXP)</li>
<li class="ie10">IE10</li>
<li class="ie11">IE11</li>
<li class="gecko">Gecko</li>
<li class="win gecko">Windows Gecko</li>
<li class="linux gecko">Linux Gecko</li>
<li class="opera">Opera Gecko</li>
<li class="konqueror">Konqueror</li>
<li class="webkit">Webkit</li>
<li class="chrome">Chrome</li>
</ul>
</div>
<div>
<ul id="classy" style="display:inline-block;">
<li style="list-style: none; border-bottom: 1px solid black;"><h4 style="margin:0;">List of classes applied</h4></li>
</ul>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="css_browser_selector.js"></script>
<script>
var classList = document.documentElement.className.split(/\s+/);
var items = document.getElementById("classy");
function writeClasses() {
for (var i = 0; i < classList.length; i++) {
var item = document.createElement("li");
item.innerHTML = classList[i];
items.appendChild(item);
}
}
jQuery(function($) {
$('#UserAgent').append(navigator.userAgent);
});
writeClasses();
</script>
</body>
</html>