Help - Search - Members - Calendar
Full Version: Handling Browser Compatibility
BleepingComputer.com > Internet & Networking > Web Site Development
   
Extrodewise
Hi guys. Anyone got an idea of how to make my HTML look the same in the browsers commonly used: IE, Firefox, Opera. It looks good in IE7 but when viewed with firefox, all my links are underlined; haven't tested with Opera and others yet. What's responsible for the underlining of the hyperlinks in Firefox? What can make the code universal (look the same in all browsers). I use FrontPage 2003.
groovicus
All browsers render things differently, although they really shouldn't. As a result, things look slightly different.

QUOTE
What's responsible for the underlining of the hyperlinks in Firefox?

There is a parser that reads the HTML. How they choose to parse the HTML depends on what rules they (the developers) decided to follow.

To answer your question though (even if a bit late):
CODE
<a href="http://www.google.com/" style=" text-decoration:none;">Google This</a>
Extrodewise
Sorry pal but I dont know exactly what you want me to do with that code. Could you explain please, Thanks.
groovicus
You are going to have to manually edit your hyperlinks to include style=" text-decoration:none;". That bit of code is what you need to use remove the underlines from your hyperlinks. I gave you an example of what a hyperlink would look like with the code added.
Extrodewise
Alright Pal, thanks once again.....Hail Groovicus!
pislkie
IMHO, you are working the wrong way round
Just about all the designers that I come accross validate their evolving pages in Firefox which is more Standards Compliant than most. You can also integrate a plugin that validates the code as you go. When it works OK in FF, then sort out the quirks in the less compliant IE7 or IE6.

The other major compatibility factor is to use the right DTD and make sure your code complies with the declaredstandard.
Extrodewise
Thanks 'pislkie' but I dont think I understood a word of what you wrote up there. Could you please break it down into more absorbable points. Look at it as if you're talking to a newbie. I think you have a powerful point, only I can't seem to place my finger on the point. Waiting to hear from you.
pislkie
OK, let me explain myself a bit.

Not all browsers display a page the same way.
This is because they interpret the various display blocks (eg div etc) in different ways
This is true even when the code is 100% standards compliant
This particularly applies to IE in all its versions
Furthermore, there are different standards to be compliant with.
You declare which standard your page will comply with by using a "Document Type Declaration" (DTD)
Of all the current browsers in common use today, Firefox is (IMO) the most standards compliant
Consequently, designers tend to review their designs as they evolve in Firefox
This will frequently leave glitches in other less compliant Browsers such as IE
Before signing of a page, it is therefore necessary to introduce "Fixes" to overcome the inconsistencies.

DTDs are a vital part of cross Browser performance and Standards in general.
If you don't include a DTD at all, most Browsers display in what is commonly called "Quirks Mode"
Quirks Mode is a way browsers display making allowances for Non Standards Compliance.

There is much information on Design and DTDs on the net just search in Google and you will find many good articles.
The W3C slant on DTDs can be found HERE
This is very comprehensive and will demonstrate the complexity of the issue.
I favour and recommend you to start using:
QUOTE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

This particular DTD says that the page is coded in HTML version 4.01 and references the W3C page that contains that coding standard definition.

All very complicated and a lot to absorb, but if you are to make your life a bit easier regarding cross browser campatibility, it has got to be understood to some degree.

I hope this cleared some of mist up for you and didn't just make things more complicated. The important thing to grasp, is that Browsers don't all display any given page the same. Further a particular Browser will display the same page differently if the DTD is changed. Hence it is VITAL, that the DTD matches the particular Standard that you used when making your pages. From experience, have found the DTD that I quotes above to be the best starting point because it relates to HTML v4.01 which is long established and widely understood.

One last point to further muddy the waters, a DTD that references a URL standard will have a different effect on a Browser to one that does not use a URL reference.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.