![]() |
![]() |
![]() |
| [ Home ] [ Link To Us ] [ About Us ] [ Contact Us ] | ||
|
Web Hosting Articles >> Browser Battles - Tackling Browser IncompatibilitiesBrowser Battles - Tackling Browser IncompatibilitiesAuthor: Rosemarie WiseAdded: May 27, 2004 Views: 2,592 Rating: 4/10 By far the most difficult problem of web design is to get your site to display how you want it to, no matter who is visiting or what they are using. My advice to you is to just learn to accept the fact that this is a mission impossible and that you'd be better off using your time more productively than to make sure it looks the same in all the browsers that are available. First things first, you should understand that each web site is unique in the sense that it will appeal to a different audience. A site that reports on the latest web technologies for example is likely to have a large proportion of their users using one of the latest browsers - whereas a site that appeals to the Linux community is less likely to be visited by those running a windows system, and because Internet Explorer only runs on Windows systems, the percentage of Internet Explorer users to such a site will be insignificant. Unless you really know what the majority of your visitors will be using to view your site, you can't rule out any of the available browsers and platforms. If your web site is predominantly text with a few occasional images that don't need to be pixel perfect, then you've got it relatively easy so long as you are aware of the font limitations in various platforms. The bulk of the problems tend to occur when you rely on pixel precision, because not only do browsers render the page margins differently, but the images and text appear smaller on a Macintosh. Web Technologies A page written in pure HTML without any style sheets or scripts can look good in almost any browser, however closer examination of the pages when viewed in different browsers reveals that there are differences. Sometimes these differences may be so subtle that you hardly notice them, but others can be obvious, depending on the complexity of the pages. Style sheets can go part of the way to provide a more precise control of the page, however the more you try to control the page using them, the more obvious these differences in browsers become. For example, you use a style sheet to set the font size of your text to 8pt and it is the exact size you wanted it to be in Internet Explorer 5 such that the paragraph beside a left aligned image is perfectly lined up. However, when you view the same page in Netscape 4.75 you are shocked to find that despite having defined the size in the style sheet, it is considerably much larger and the effect of the page is ruined! It will be a long time before we can use style sheets safe in the knowledge that such indiscrepancies won't occur, but in the meantime we will have to either put up with it or find work-arounds for it. One such work around is to design a different style sheet for different browsers (which incidentally, is what we do here). You can then use either server side scripts (such as ASP, PHP or Perl) or client side scripts such as JavaScript or VBScript to detect the browser version and load the appropriate style sheet. Design your style sheet so that it looks exactly how you want it to with your preferred browser, then, once you are happy - take a look at how it appears in another browser. Make a copy of your original style sheet and work on the copy to make the changes needed to make it look more like it does in your preferred browser. Netscape and Internet Explorer can vary widely, particularly in relation to the fonts that they use and so you should try to make versions of the style sheet for these two browsers at least. NB. Netscape 6 looks like it will behave more like Internet Explorer than Netscape 4.x so you may need three style sheets (or more) to capture the majority of your visitors. Style Sheets the Key to Compatibility? Style sheets are certainly useful, and when teamed up with scripts can tackle some of the more common problems associated with precision control of web pages. But don't rely too heavily on them just yet. You might well be able to do some stunning effects with text and positioning if you know what you are doing - however, browsers that do support CSS may not support all the features you intend to use, and while you might be able to work your magic in one browser, it could look tacky on another. If you have a feature that is important to your site, say for example you want to draw the attention to a message by putting some sort of frame around it; it is always a good idea to use a HTML backup where ever possible. Relying solely on your style sheet to highlight it will mean that the message would not be highlighted should the style sheet not load or not be supported. Talk about this article in the webmaster forums! More Web Site Design Articles |