Despite writing a good valid code and a valid CSS for your webpage, if you don’t specify the right DOCTYPE or you won’t specify it at all meaning that your page will be rendered in quirks mode and it can behave strange displaying visual errors that can be very unpredictable damaging your layout.
Bellow is a list with the most common DTDs I in my developing process respectively for HTML 4.01, XHTML 1.0 Transitional, XHTML 1.0 Strict.

PHP:
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3.  
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  5. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6.  
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  8. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">