1 Replies - 1023 Views - Last Post: 10 August 2012 - 05:32 AM

#1 miss_crimson  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 28-January 12

Is there a code for Browser compatibility in HTML?

Posted 10 August 2012 - 04:53 AM

I've used this doctype declaration provided in my Dreamweaver software by default:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

I supposed that with this declaration, my html codes will have the same output in diff browsers (at least in Chrome, IE and Firefox). But the problem is, when I run my codes in these 3 browsers, it will have different outputs. The output in Chrome is the one that looks good while in IE and Firefox, the output is messed already (eg. the margin is diff., logo overlap with the website name, and other stuffs like that). Do you guys have any idea on how can I solve this problem?

I am using Dreamweaver v8, Firefox 14.0.1, IE8 and Chrome 21.0.1180.75 m .... Thanks in advance guys...
By the way, I'm a newbie in web development, so I pls be kind and a little patient to me. Thank you. :)

Is This A Good Question/Topic? 0
  • +

Replies To: Is there a code for Browser compatibility in HTML?

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1010
  • View blog
  • Posts: 3,566
  • Joined: 05-June 09

Re: Is there a code for Browser compatibility in HTML?

Posted 10 August 2012 - 05:32 AM

Fix your markup ;)

A Doctype will only go so far into ensuring that you're in standards mode, but if your code is non-compliant/bad then it's not going to help you there.

If you put it online somewhere and let us take a look we'll be able to provide more concise advice.

A couple of things:
1; Don't use Dreamweaver (At least not design view!)
2; It's probably better these days to just use a <!DOCTYPE html> doctype. It won't fix your code, but will not throw errors if you started doing some more HTML5-y things.
3; Each browser (well, older versions!) generally have a different way of doing things that will need to be worked around. That said, in recent versions of browsers (talking Fx3.5+ and IE>8), there's very little difference providing that your markup is actually valid and makes sense.

This post has been edited by RudiVisser: 10 August 2012 - 05:33 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1