There are many ways we can deal with CSS browser compatibility issue. Such as using Box model design or developing different style sheets for different browsers or using Dynamic CSS techniques (writing PHP script in CSS file).
Is there any way that we can know that Style which is being executed in the browser is supported by that browser or not?
Can we write code something like below in dynamic CSS using PHP code. I mean is there any function or way to achieve this functionality.
FILENAME: styles.css.php
<?php
header("content-type: text/css");
// isStyleSupported() function will return true or false with respect to the browser it is being executed
if (isStyleSupported('min-width')) {
// styles here
} else {
// alternative style here
}
?>
I know it might be difficult to keep the record of different version of browsers with respect to its CSS support. But still curious, if anyone know any solution or alternative method?