check-browsers
Version:
Check your desktop browser and version(Internet Explorer)
125 lines (106 loc) • 2.41 kB
Markdown
[](https://www.npmjs.com/package/check-browsers)
[](https://www.jsdelivr.com/projects/check-browsers)


It is detect your browser and version(Ineternet Explorer).
It detects only desktop browser not mobile browser.
It helps your page styling for each browser.
It appends class with html root element.
```html
<html class="browser type">
```
If you known some idea for mobile browser, you could send pull request.
1. [Installation](
2. [Usage](
1. [In HTML](
2. [In module, Webpack, etc.](
3. [In CSS](
3. [Browser List](
Using CDN:
```
<script src="//cdn.jsdelivr.net/check-browsers/1.0.4/check-browsers.min.js"></script>
```
Using npm:
```
$ npm i -S check-browsers
```
Using yarn:
```
$ yarn add check-browsers
```
```html
<head>
...
<script src="/node_modules/check-browsers/dist/check-browsers.min.js"></script>
...
<link rel="stylesheet" href="..." />
...
</head>
```
You should import it in head element and before stylesheet.
Because importing in head is processed before page rendering.
and importing before stylesheet is processed before styling.
So page styling is more fast.
```javascript
require('check-browsers');
```
```javascript
import 'check-browsers';
```
```css
@charset "utf-8";
/* default style */
font-size: 3em
}
/* each browser style */
.ie6
color: salmon
}
.ie7
color: red
}
.ie8
color: blue
}
.ie9
color: purple
}
.ie10
color: orange
}
.ie11
color: green
}
.edge
color: gray
}
.chrome
color: navy
}
.firefox
color: lime
}
.safari
color: fuchsia
}
.opera
color: brown
}
```
* IE6~11: ie6~11
* MS Edge: edge
* Google Chrome: chrome
* Mozilla Firefox: firefox
* Apple Safari: safari
* Opera: opera