Software & UtilitiesTechnology

Dymanically Select Targeting Broswer In CSS Using PHP

php-css-cross-browser-selector

It is so clear that the web design world is full of incompabilities with different behaviours on different browsers, browser versions and OSs.

PHP CSS Browser Selector is a tiny PHP function which enables us to write specific CSS code for each operating system and each browser.

nce it is called (<?php echo css_browser_selector() ?>), it outputs something similar to “gecko ff3 win” according to your OS and browser environment.

When you call it inside the class of an element, just like: <html class="<?php echo css_browser_selector() ?>"> will return <html class="gecko ff3 win">.

And, if you have the rules ready for .gecko, .ff3 and .win, then you’re all set.

The function is a good fit, specially if you’re not able to target users with JavaScript for a reason (usually, if the JS is turned of)

Website: http://www.bastian-allgeier.de/css_browser_selector/

You can find a more feature rich version of the browser detector in my little PHP toolkit, called Kirby

Admin

We hope, We will become the best, creative and inspiring community for web and graphics. Join Us! Can be part of the growing Team. Just write something Creative and Interesting. Click here to become a member.

One thought on “Dymanically Select Targeting Broswer In CSS Using PHP”

Comments are closed.

0 Shares
Tweet
Share
Share
Pin