Jump to content

Most efficient browser determination method


freelance84

Recommended Posts

http://www.phpfreaks.com/forums/index.php/topic,308549.0.html

 

The above link is a problem relating to CSS. The way route i've choosen thanks to haku is to determine the users browser then let php give one css or another.

 

What is the best way to determine the users browser. At the moment i can only find a problem with css fixed in ie6 and below. Therefore i only really need to find if the user is running on ie6.

 

I've come accross the http://php.net/manual/en/function.get-browser.php but requires http://browsers.garykeith.com/downloads.asp.

 

Is there a simpler way?

you should never need to do this.. :) unless you're delivering browser dependant plugins or operating system specific..

 

the popup can work solely on position: absolute; across every browser..

 

you just need to declare the popup in html source OUTSIDE of your content div.. for example..

 

<body>
  <div>LALALALA</div>
  <div id="popup">
  </div>
</body>

 

then code it  the wya you normally would :)

 

however, I also suggest you make #popup width: 100%; and inside have a popupContainer.. that is X wide or whatever.. position: relative; margin: auto;

 

that will position it in the center aslong as #popup has text-align: center; specified :)

 

good luck

And besides, I don't think haku was referring to you using PHP to determine the users browser when referring to conditional statements, but Conditional Comments.

 

If you really need to load a separate stylesheet for IE:

<!--[if IE 6]>
Load another stylesheet for IE
<![endif]-->

 

More information can be found here.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.