Add conditional browser stylesheets and body class declarations
Author: | Q Studio (profile at wordpress.org) |
WordPress version required: | 3.2 |
WordPress version tested: | 4.4.1 |
Plugin version: | 0.4.7 |
Added to WordPress repository: | 10-12-2013 |
Last updated: | 17-01-2016
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
Rating, %: | 100 |
Rated by: | 2 |
Plugin URI: | http://qstudio.us/plugins/ |
Total downloads: | 2 929 |
Active installs: | 60+ |
Click to start download
|
FAQ
How do I add and access browser specirfic stylesheets?
To add extra stylesheets, create a new CSS file and upload it to the root of your active theme or in the directory THEME/library/css/ – you can include a mixture of 3 values:
- Operating System name ( windows, mac, linux )
- Browser Name ( firefox, safari, chrome, msie )
- Browser Version ( a specific whole version number )
The plugin then looks for a matching CSS file in the root of the active theme or in the directory THEME/library/css/ using a combinations of these 3 values ( in these example we’ll use IE 10 on windows ):
- browsers-msie.css
- browsers-msie-10.css
- browsers-windows-msie.css
How do I select browser specific classes in my CSS files?
The Browsers plugin adds a collection of extra browser and operating system specific classes to the HTML <body> tag of all front-end pages of the current active theme.
The best way to find out what classes are added is to use a source code inspector like Google Chrome’s Inspector to view the <body> tag.
You can then use these new classes to select HTML elements in the following way ( again using IE 10 as an example ):
~~ style.css ~~
body.browsers-msie-10 {
background-color: red;
}
~~~~~~~~~~~~
ChangeLog
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.1
0.4.0
- Readyness for Q Theme Framework integration
0.3.4
0.3.1
- Correction to stylesheet location function
0.3
- Body tags and CSS file names homogenized
0.2