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
- CSS layout will not work with the DTD
- Why do I want to write class independant of my selectors?
- Commenting not working
- Which should I use, relative or absolute positioning?
- Exporting Individual Slices
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