<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="http://github.com/rafaelp/css_browser_selector/raw/master/css_browser_selector.js" type="text/javascript"></script>
<style type="text/css">
.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
}
.example {
width: 100px;
height: 100px;
}
.no_js { display: block }
.has_js { display: none }
.js .no_js { display: none }
.js .has_js { display: block }
</style>
</head>
<body>
<div class="example" style="width:50px; height:50px;">
</div>
</body>
</html>
USAGE
1. Copy and paste the line below, inside <head> and </head> tag
<script src="css_browser_selector.js" type="text/javascript"></script>
2. Set CSS attributes with the code of each browser/os you want to hack
Examples:
- html.gecko div#header { margin: 1em; }
- .opera #header { margin: 1.2em; }
- .ie .mylink { font-weight: bold; }
- .mac.ie .mylink { font-weight: bold; }
- .[os].[browser] .mylink { font-weight: bold; } -> without space between .[os] and .[browser]
Available OS Codes [os]:
- win - Microsoft Windows (all versions)
- vista - Microsoft Windows Vista new
- linux - Linux (x11 and linux)
- mac - Mac OS
- freebsd - FreeBSD
- ipod - iPod Touch
- iphone - iPhone
- ipad - iPad new
- webtv - WebTV
- j2me - J2ME Devices (ex: Opera mini) changed from mobile to j2me
- blackberry - BlackBerry new
- android - Google Android new
- mobile - All mobile devices new
Available Browser Codes [browser]:
- ie - Internet Explorer (All versions)
- ie8 - Internet Explorer 8.x
- ie7 - Internet Explorer 7.x
- ie6 - Internet Explorer 6.x
- ie5 - Internet Explorer 5.x
- gecko - Mozilla, Firefox (all versions), Camino
- ff2 - Firefox 2
- ff3 - Firefox 3
- ff3_5 - Firefox 3.5
- ff3_6 - Firefox 3.6 new
- opera - Opera (All versions)
- opera8 - Opera 8.x
- opera9 - Opera 9.x
- opera10 - Opera 10.x
- konqueror - Konqueror
- webkit or safari - Safari, NetNewsWire, OmniWeb, Shiira, Google Chrome
- safari3 - Safari 3.x
- chrome - Google Chrome
- iron - SRWare Iron
Extra Codes:
- js - Will be available when js is enable, so you can show/hide some stuffs
Harwinderpal singh
Country INDIA
City Chandigarh
Posted On 18/05/2012
4
Other Pages
- for coding software
- bridgemanart.com
- for mockup wireframe software
- usefull links dlt
- dlt it
- pop up goes away on click other part
- Scroll to Anchors With jQuery
- make common height to all divs
- connect
- if condition on click (jquery)
- input onclick text goes away code
- How to make shapes with css3
- @ media css for responsive design
- Rotating divs with css
- @ media screen for all devices
- jquery dropdown
- css according to screen
- Browser selecter java script
- online jquery path address
- how to onclick text remove in input
- css inner drop shadow code
- css font face code
- css opacity in all browsers
- css border radius
- how to make drop down css
- css specificing points
- css hack for all browsers