Ik heb een XHTML file, ik ik nog moet modifyen van HTML 4.01 naar XHTML 1.0 Transitional.
Het probleem is dat zodra ik bovenaan [het is een .asp script] de doctype:
gebruik de pagina opeens helemaal screwed up word weergegeven, ipv dat alles links was uitgelijnd word na toevoeging van de doctype opeens alles CENTER uitgelijnt, terwijl dit niet in de XHTML/HTML code staat. Tevens heb ik een style meegegeven aan de scrollbars (voor IE) maar die style verdwijnt ook direct na toevoeging van de doctype!
Ik las op www.w3schools.com wel dit:
Your pages must have a DOCTYPE declaration if you want them to validate as correct XHTML.
Be aware however, that newer browsers (like Internet Explorer 6) might treat your document differently depending on the <!DOCTYPE> declaration. If the browser reads a document with a DOCTYPE, it might treat the document as "correct". Malformed XHTML might fall over and display differently than without a DOCTYPE.
Waarom gebeurd dit en hoe kan ik dit voorkomen?
Het probleem is dat zodra ik bovenaan [het is een .asp script] de doctype:
HTML:
1
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
gebruik de pagina opeens helemaal screwed up word weergegeven, ipv dat alles links was uitgelijnd word na toevoeging van de doctype opeens alles CENTER uitgelijnt, terwijl dit niet in de XHTML/HTML code staat. Tevens heb ik een style meegegeven aan de scrollbars (voor IE) maar die style verdwijnt ook direct na toevoeging van de doctype!
Ik las op www.w3schools.com wel dit:
Your pages must have a DOCTYPE declaration if you want them to validate as correct XHTML.
Be aware however, that newer browsers (like Internet Explorer 6) might treat your document differently depending on the <!DOCTYPE> declaration. If the browser reads a document with a DOCTYPE, it might treat the document as "correct". Malformed XHTML might fall over and display differently than without a DOCTYPE.
Waarom gebeurd dit en hoe kan ik dit voorkomen?