Posts

Showing posts from October, 2013

CSS Browser Selector

Clever technique to help you on CSS hacks. CSS Browser Selector is a very small javascript with just one line which empower CSS selectors. It gives you the ability to write specific CSS code for each operating system and each browser. Download the CSS Browser Selector javascript file from following link. http://github.com/rafaelp/css_browser_selector/raw/master/css_browser_selector.js And here's usage of the file. Copy and paste bellow line inside head section of your document. <script src="css_browser_selector.js" type="text/javascript"></script> Set CSS attributes with the code of each Browser/OS you want to hack as given bellow example. 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