Document Type Declaration doesn’t work when I use an echo statement in PHP.

This is actually mostly a PHP thing, but since I don’t have a section for PHP and it uses HTML tags.

The problem is that you cannot have anything print out to screen before the Document Type Declaration (DTD) at the top of your HTML document. It can cause funny things to happen. If you are using it just for testing purposes, don’t worry about the errors continuing when you post your site pages live.

The particular problem we were having was with a center aligned using CSS content section. By the DTD not being declared first, the CSS was not reading correctly and hence did not look right.

Here are some similar arcade posts
Print This Post Print This Post

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)