Sometimes when you're writing HTML you'll find yourself in a situation where the code you want to use will only work on one browser (and we all know which browser that is). Not only won't it work on other browsers, but one specific browser (and we all know which that is) crashes and burns, or won't show the page at all. In this case you can detect the browser with PHP and only show the dodgy code on IE, or show something else on Netscape.
Whenever a browser asks a webserver for a page, it presents some information to the server (like which page it wants, and what browser it is.. ) and PHP turns this information into variables when it loads. Check out the $_SERVER['HTTP_USER_AGENT '] variable; it contains the name and version of the browser. The problematic browser, especially regarding Cascading Style-sheet bugs is Netscape 4, between 4.1 and 4.8 . We don't include 4.0 because that's what Internet explorer pretends to be.
So now, in your HTML code, or in your style-sheet if you keep them separate:
<style type="text/css">
<!--
<? // Browser check: Netscape 4.x can't deal with borders on CSS elements
if (!eregi("^Mozilla/4.[1-8]", $_SERVER['HTTP_USER_AGENT'])) {
$css_border = "border: 1px #FFFFFF solid;";
} else {
$css_border = "";
}
?>
SELECT {
background: #002F54;
color: #FFFFFF;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
<?=$css_border?>
}
--></STYLE>