Can you show us one of your
php pages you are having problems with the doctype, I suspect your problem may be that the
php code is starting after your doctype giving you a "headers already sent" error.
As for the styling, until we see the code not much we can do.
HTH
Pat