Jump to content

How To Tell My Site To Read What Browser Is Viewing It


how2html
 Share

Recommended Posts

As of now, my website looks perfect on all browsers except for on cell phones. I want to know how I can adjust settings so that it looks like this on one browser, then looks like this on another browser, and so on.

Link to comment
Share on other sites

You have the right idea, but the wrong technique. You certainly don't want to get lost in the jungle of browser sniffing, so you're doing one thing for IE, another for Firefox, etc.But CSS provides an easy tool for specifying different rules for KINDS of browsers. This is the @media rule. http://www.w3schools.com/CSS/css_mediatypes.aspYou're sure to find something there that helps.

Link to comment
Share on other sites

or, you could use JavaScript to get the navigatorname, and choose an style.var browser=navigator.appName;document.location="index.php?browser="+browser;and then with PHPif (issert($GET['browser'])){echo "here the css tag"}

Link to comment
Share on other sites

What phones? You might want to see some of PPK's mobile compatibility tables... or maybe not, as they will turn you down... it is a real torture to develop a site that works well on any phone (except maybe the iPhone, where it's only a slight hurdle, when you consider the :hover and all that), and developing a site to work on any phone is a whole nightmare.You might use a library like WURFL to sniff the exact phone and browser combo at the server side, but you'll have to tailor your site for only a selected bunch, and give some default (potentially broken) experience to everyone else.

Link to comment
Share on other sites

Thanks for the topic and replies. Would not want the cell phone to have the exact same interface as a full sized screen, IMO. Look at what Facebook looks like in monitor mode then in cell phone mode. I would go with the first suggestion, css media type rules. Have you used the media type for printer, so a page prints differently than it displays on the monitor? Same idea. Some pepole will make two seperate pages, one for printing, one for viewing. But both can be effectively rendered as one. Consider Cell phone deserves a scaled down display, for it's scaled down viewing area. IMO

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...