This repository has been archived by the owner on Aug 25, 2021. It is now read-only.
forked from ridjohansen/css_browser_selector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_en.html
583 lines (522 loc) · 19.7 KB
/
index_en.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>CSS Browser Selector + | A Cross-browser Responsive Design Helper</title>
<meta name="description" content="CSS Browser Selector + is a very small javascript which empowers CSS selectors. A Cross-browser Responsive Design Helper">
<meta name="viewport"
content="initial-scale=1.0, width=device-width, height=device-height, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- <link rel="stylesheet" href="css/bootstrap.min.css"> <!--(original)-->
<!-- Veja mais em: http://bootswatch.com/ -->
<!-- <link rel="stylesheet" href="http://bootswatch.com/amelia/bootstrap.min.css"> <!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/cerulean/bootstrap.min.css"> <!--(skin)-->
<!-- -->
<link rel="stylesheet" href="http://bootswatch.com/cyborg/bootstrap.min.css">
<!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/journal/bootstrap.min.css"> <!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/readable/bootstrap.min.css"> <!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/simplex/bootstrap.min.css"> <!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/slate/bootstrap.min.css"> <!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/spacelab/bootstrap.min.css"> <!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/spruce/bootstrap.min.css"> <!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/superhero/bootstrap.min.css"> <!--(skin)-->
<!-- <link rel="stylesheet" href="http://bootswatch.com/united/bootstrap.min.css"> <!--(skin)-->
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<!--[if lt IE 9]>
<link rel="stylesheet" href="css/bootstrap-responsive_lt-ie9.css">
<![endif]-->
<link rel="stylesheet" href="css/style.css">
<script src="js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script>
<script src="js/vendor/css_browser_selector.js"></script>
<!-- <script src="js/vendor/css_browser_selector.min.js"></script> -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.1.min.js"><\/script>')</script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</head>
<body data-spy="scroll" data-target=".navbar">
<!--[if lt IE 7]>
<div class="container">
<div class="hero-unit chromeframe">
You are using an outdated browser.
<a href="http://browsehappy.com/">Upgrade your browser today</a> or <a
href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience
this site.
</div>
</div>
<![endif]-->
<header class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">CSS Browser Selector +</a>
<nav class="nav-collapse collapse">
<ul class="nav">
<li><a href="#Home">Home</a></li>
<li><a href="#Identifies">Identifies</a></li>
<li><a href="#Resources">Resources</a></li>
<li><a href="#Example">Example</a></li>
<li><a href="#License">License</a></li>
<li><a href="#Contributors">Contributors</a></li>
</ul>
</nav>
<!--/.nav-collapse -->
</div>
</div>
</header>
<article class="container">
<!-- Main hero unit for a primary marketing message or call to action -->
<div class="hero-unit" id="Home">
<h1>CSS Browser Selector +</h1>
<style>
.test {
display: none;
}
.hidpi .ret { display: block!important; }
.retina_1x .ret_1x { display: block!important; }
.retina_2x .ret_2x { display: block!important; }
</style>
<p>
<span class="test ret">
Hi-dpi screen
</span>
<span class="test ret_1x">
Pixel-ratio > 1 and < 2
</span>
<span class="test ret_2x">
Pixel-ratio >= 2
</span>
</p>
<h2>A Cross-browser Responsive Design Helper</h2>
<p>
CSS Browser Selector + is a very small javascript which empowers CSS selectors.
</p>
<h4>See an example:</h4>
<pre>
<html lang="pt-br" class="webkit chrome chrome21 win win8 js orientation_landscape minw_980 maxw_1199">
</pre>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<p>
<a href="https://github.com/ridjohansen/css_browser_selector/zipball/master"
class="btn btn-block btn-large btn-success">
CSS Browser Selector Download
</a>
</p>
<p>
<a href="https://github.com/ridjohansen/css_browser_selector/"
class="btn btn-block btn-large btn-warning">
Github
</a>
</p>
</div>
</div>
<div class="row-fluid">
<ul class="unstyled">
<li class="span4">
<h3 class="btn btn-block btn-large btn-primary">Best part</h3>
<ul>
<li>no more hacks</li>
<li>all compliant code</li>
</ul>
</li>
<li class="span4">
<h3 class="btn btn-block btn-large btn-primary">Cross-browser Media Queries like helper</h3>
<p>Alternative method of mediaqueries for developing responsive design for older browsers.</p>
</li>
<li class="span4">
<h3 class="btn btn-block btn-large btn-primary">You can now write code for</h3>
<ul>
<li>browser</li>
<li>browser version</li>
<li>platform</li>
<li>platform version</li>
<li>device</li>
<li>device version</li>
<li>min-width and</li>
<li>max-width screen detection</li>
<li>orientation screen detection (landscape or portrait).</li>
</ul>
</li>
</ul>
</div>
</div>
<p>
<strong>More info:</strong>
<br/>(http://rafael.adm.br/css_browser_selector)
</p>
<p>
<strong>beta/experimental versions:</strong>
<br/>(https://github.com/ridjohansen/css_browser_selector/)
<br/>(https://github.com/verbatim/css_browser_selector/)
</p>
</div>
<!-- Example row of columns -->
<div class="row">
<div class="span12">
<h2 id="Identifies">Identifies</h2>
<ul>
<li>browsers: Firefox; IE; Opera; Safari; Chrome, Konqueror, Iron</li>
<li>browser versions: (most importantly: ie6, ie7, ie8, ie9)</li>
<li>rendering engines: Webkit; Mozilla; Gecko</li>
<li>platforms/OSes: Mac; Win: Win8, Win7, Vista, WinXP, Win2k, WinNT; FreeBSD; Linux/x11</li>
<li>devices: Ipod; Ipad; Iphone; WebTV; Blackberry; Android; J2me; RIM Playbook; mobile (generic)</li>
<li>enabled technology: JS (use in conjunction with <html class="no-js"> for even more granular control)</li>
<li>max-width e min-width screen detection (helper for Media Queries like screen width classes)</li>
<li>browser orientation detection (helper for Media Queries like orientation classes)</li>
<li>language detection</li>
</ul>
<h4>Recent contributors to 0.5, 0.6, 0.7:</h4>
<ul>
<li>
<strong>improve and update features for cross-browser development</strong>
<br/>https://github.com/ridjohansen/css_browser_selector/
</li>
<li>
<strong>more detailed IE detection:</strong>
<br/>https://github.com/kevingessner/css_browser_selector/
</li>
<li>
<strong>more detailed WIN detection:</strong>
<br/>https://github.com/saar/css_browser_selector
</li>
<li>
<strong>no-js to js:</strong>
<br/>paul irish: http://paulirish.com/2009/avoiding-the-fouc-v3/
</li>
<li>
<strong>mac versioning</strong>
<br/>https://github.com/haraldmartin/css_browser_selector
</li>
</ul>
<h4>Version History</h4>
<ul>
<li>
<strong>v0.6.2 2012-09-10</strong>
<br/>add new features for cross-browser development
<br/>update the commons devices width (based on Twitter Bootstrap)
<br/>improve continuously evaluates browser max-width and min-width (helper for Media Queries like screen
width classes)
<br/>improve continuously evaluates browser orientation (helper for Media Queries like orientation
classes)
</li>
<li>
<strong>v0.6.1 2012-03-14</strong>
<br/>iOS version detection
<br/>beta: detect if being run in iPad app.
<br/>(from: http://stackoverflow.com/questions/4460205/detect-ipad-iphone-webview-via-javascript)
</li>
<li>
<strong>v0.6.0 2012-01-24</strong>
<br/>more detailed support for Opera, Chrome, Safari (and revised support for Firefox)
<br/>versioning for Chrome, Blackberry, Android, Mac
<br/>Android device detection
<br/>altered how 'mobile' is deterimed to be added to the class string
<br/>language detection
<br/>RIM Playbook added
<br/>continuously evaluates browser max width (in case of resizing)
<br/>continuously evaluates browser orientation (portrait vs. landscape)
</li>
<li>
<strong>v0.5.0 2011-08-24</strong>
<br/>any version of Firefox
<br/>more versions of Windows (Win8 [tentative], Win7, Vista, XP, Win2k)
<br/>more versions of IE under unique conditions
<br/>if "no-js" in HTML class: removes and replaces with "js" (<html class="no-js">)
</li>
</ul>
<h2 id="Resources">Resources</h2>
<ul>
<li>
<strong>navigator.userAgent strings:</strong>
<br/>http://en.wikipedia.org/wiki/User_agent
<br/>http://www.useragentstring.com/pages/useragentstring.php
<br/>http://www.user-agents.org
<br/>http://www.zytrax.com/tech/web/mobile_ids.html
</li>
<li>
<strong>history of the user agent string:</strong>
<br/>http://www.nczonline.net/blog/2010/01/12/history-of-the-user-agent-string/
</li>
<li>
<strong>language list:</strong>
<br/>http://msdn.microsoft.com/en-us/library/ms533052%28v=vs.85%29.aspx
</li>
<li>
<strong>windows nt list</strong>
<br/>http://en.wikipedia.org/wiki/Windows_NT
</li>
<li>
<strong>blackberry user agent string interpertation:</strong>
<br/>http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-to-detect-the-BlackBerry-Browser/ta-p/559862
</li>
<li>
<strong>javascript compression:</strong>
<br/>http://minifyjavascript.com
</li>
<li>
<strong>screen resolutions:</strong>
<br/>http://cartoonized.net/cellphone-screen-resolution.php
</li>
<li>
<strong>aspect ratio:</strong>
<br/>http://www.htmlgoodies.com/beyond/webmaster/toolbox/article.php/3889591/Detect-and-Set-the-iPhone--iPads-Viewport-Orientation-Using-JavaScript-CSS-and-Meta-Tags.htm
</li>
<li>
<strong>iOS detection:</strong>
<br/>http://stackoverflow.com/questions/4460205/detect-ipad-iphone-webview-via-javascript
</li>
</ul>
<h4>Other Versions</h4>
<ul>
<li>
<strong>Ruby on Rails Plugin by Reid MacDonald</strong>
<br/>http://latimes.rubyforge.org/svn/plugins/css_browser_selector/
</li>
<li>
<strong>PHP CSS Browser Selector by Bastian Allgeier</strong>
<br/>http://bastian-allgeier.de/css_browser_selector/
<li>
<strong>Wordpress Plugin by Adrian hanft</strong>
<br/>http://wordpress.org/extend/plugins/browser-specific-css/
</li>
</ul>
<h2 id="Example">Example</h2>
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
<h3 class="btn btn-block btn-large btn-primary">Browser, Device, OS and Javascript detection</h3>
<pre>
<style>
.ie .example { background-color: yellow; }
.ie7 .example { background-color: orange }
.gecko .example { background-color: gray; }
.win.gecko .example { background-color: red; }
.linux.gecko .example { background-color: pink; }
.opera .example { background-color: green; }
.konqueror .example { background-color: blue; }
.webkit .example { background-color: black; }
.chrome .example { background-color: cyan; }
.example { width: 100px; height: 100px; }
.no-js, .no_js, .nojs { display: block; }
.js { display: none; }
</style>
</pre>
</div>
<div class="span4">
<h3 class="btn btn-block btn-large btn-primary">dataURI Selector</h3>
<pre>
<style>
.datauri .example_bg {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC');
}
.no-datauri .example_bg {
background-image: url('bg_default.png');
}
.datauri .img_default, .no-datauri .img_uri {
display: none !important;
}
</style>
<div class="example_bg">
<img class="img_uri" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC" alt="with dataURI" />
<img class="img_default" src="img_default.png" alt="without dataURI" />
</div>
</pre>
</div>
<div class="span4">
<h3 class="btn btn-block btn-large btn-primary">Hi-dpi and Pixel-Ratio Selector</h3>
<pre>
<style>
.img_hidpi {
display: none;
}
.no-hidpi .example_bg {
background-image: url('bg_default.png');
}
.hidpi .img_default, .no-hidpi .img_hidpi {
display: none !important;
}
.retina_1x .example_bg {
background-image: url('bg_hidpi_1x.png');
}
.retina_2x .example_bg {
background-image: url('bg_hidpi_2x.png');
}
.retina_2x .img_default, .retina_2x .x1 {
display: none !important;
}
.retina_1x .img_default, .retina_1x .x2 {
display: none !important;
}
or /* http://bjango.com/articles/min-device-pixel-ratio/ */
@media
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
.example_bg {
background-image: url('bg_hidpi_1x.png');
}
.img_default, .x2 {
display: none;
}
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
.example_bg {
background-image: url('bg_hidpi_2x.png');
}
.img_default, .x1 {
display: none;
}
}
</style>
<div class="example_bg">
<img class="img_hidpi x2" src="img_hidpi_2x.png" alt="with pixel-ratio >= 2" />
<img class="img_hidpi x1" src="img_hidpi_1x.png" alt="with pixel-ratio > 1 and < 2" />
<img class="img_default" src="img_default.png" alt="with pixel-ratio 1 or default" />
</div>
</pre>
</div>
<div class="span4">
<h3 class="btn btn-block btn-large btn-primary">Media Queries (Screen Width)</h3>
<pre>
<style>
@media (max-width: 767px) {
.example {
border: 2px solid purple!important;
}
}
/* or */
.minw_0 .example, .maxw_767 .example {
border: 2px solid purple!important;
}
@media (min-width: 768px) and (max-width: 979px) {
.example {
border: 2px solid green!important;
}
}
/* or */
.minw_768.maxw_979 .example {
border: 2px solid green!important;
}
@media (min-width: 1200px) {
.example {
border: 2px solid orange!important;
}
}
/* or */
.minw_1200 .example {
border: 2px solid orange!important;
}
</style>
</pre>
</div>
<div class="span4">
<h3 class="btn btn-block btn-large btn-primary">Media Queries (Orientation)</h3>
<pre>
<style>
@media (orientation: landscape) {
.example {
border: 2px solid red!important;
}
}
/* or */
.orientation_landscape .example {
border: 2px solid red!important;
}
@media (orientation: portrait) {
.example {
border: 2px solid blue!important;
}
}
/* or */
.orientation_portrait .example {
border: 2px solid blue!important;
}
</style>
</pre>
</div>
</div>
</div>
<h2 id="License">License</h2>
<p>http://creativecommons.org/licenses/by/2.5/</p>
<h4>Original Author:</h4>
<p>
<strong>Rafael Lima:</strong>
http://rafael.adm.br
</p>
<h4>Based on idea by 37signals</h4>
<p>http://37signals.com/svn/archives2/browser_selectors_in_css.php</p>
<h2 id="Contributors">Contributors</h2>
<ul>
<li>Richard Duchatsch Johansen @ridjohansen (http://github.com/ridjohansen)</li>
<li>Niyaz (http://github.com/niyazpk)</li>
<li>Marcio Trindade (http://github.com/marciotrindade)</li>
<li>rbottarelli (http://github.com/rbottarelli)</li>
<li>Bryan Chow (http://github.com/bryanchow)</li>
<li>Derek Lio (http://github.com/dereklio)</li>
<li>Paul Irish (http://github.com/paulirish)</li>
<li>Preston Badeer</li>
<li>Upekshapriya</li>
<li>André Lopes</li>
<li>Tazio Mirandola - copiaincolla pubblicità</li>
<li>Reid MacDonald (http://geminstallthat.wordpress.com)</li>
<li>Vinicius Braga (http://viniciusbraga.com)</li>
<li>Chris Preece (http://www.mmtdigital.co.uk)</li>
<li>Dominykas</li>
<li>M@ McCray</li>
<li>Daniel Westermann-Clark</li>
<li>Steve Clay (http://mrclay.org/)</li>
<li>Jeff Bellsey</li>
<li>Jean Pierre</li>
<li>Micah Snyder</li>
<li>Derek (http://amphibian.info)</li>
<li>Jesse Scott</li>
<li>Moises Kirsch (http://www.moiblog.com/)</li>
<li>Alex Wiltschko</li>
<li>Chris Warren and Tony Nelson (http://www.imagetrend.com)</li>
<li>glasser</li>
</ul>
</div>
</div>
</article>
<!-- /container -->
<hr class="container">
<footer class="container">
<p>
Richard Duchatsch Johansen (ridjohansen)
| <a href="http://twitter.com/ridjohansen">Twitter</a>
| <a href="http://facebook.com/ridjohansen">Facebook</a>
| <a href="http://linkedin.com/in/ridjohansen">LinkedIn</a>
| <a href="http://slideshare.net/ridjohansen">Slideshare</a>
| <a href="http://klout.com/ridjohansen">Klout</a>
</p>
</footer>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-34735780-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>