web dev – browser compatibility

18 09 2010

Recently restart some development on web page. Encounter some browser compatibility issue between IE and the others (sad we still need to support the IE 6)

After several attempts, finally find out it missing following line.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”&gt;

below is very good explanation:


<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
is what’s know as a “document type declaration (or definition)” (DTD). In essence it identifies to the browser the type of code that is being used in the document. When declaring a doctype, it is then your responsibility as a designer to code the page to the specifications you have “declared” you are using in the doctype. In your example, you are declaring to the browser that you will be writing your code to HTML 4.01 transitional specifications and that is what it is expecting. If you falter from those “expectations” then your code may become considerd as “invalid” and may not display correctly in some browsers.

This is where things start to get a little confusing. The transitional doctype was institituted to allow a transitional period for designers to migrate from older coding standards to newer coding standards. An alternative to a “transitional” doctype would be a “strict” doctype.

In the example you have provided the distinction would be that for a “strict” doctype to be valid and display correctly, then you must write the code for your pages specifically to HTML 4.01 standards, whereas using a “transitional “doctype would allow you to use depracated (i.e. obsolete) code from say perhaps, HTML 4.0 or HTML 3.2 and, although it’s planned to eventually be elliminated would at least still work for the time being.

An example would be <font> tags. Very old coding practice and now depricated and has been replaced by using style instead.

For more on doctype declarations (a.k.a. DTD’s) go here
http://www.w3schools.com/tags/tag_doctype.asp

link: http://www.ozzu.com/website-design-forum/first-line-html-code-doctype-html-public-t58206.html

another thing is the MUST HAVEĀ  (life saving) tools:

– firebug

– html validator.

Just hard believe how people to develop page without these tools in the old day.

Salute to the developers them.





favicon – online favicon creator

25 07 2009

favicon.cc is a Online favicon creator. It is fast and easy to use (even in compare with icon creator program).

I am used this site to build icon for my google site, highly recommend!