During the process of converting from HTML4 to HTML5, I compared my html4 and html5 pages and noticed that removing deprecated elements after the doctype declaration was causing slight movements in on-screen elements. For example, in the code snippet below, the anchor tag appears to have a 3 pixel padding at the bottom that is not visible in debug tools, but is visibly shifting down in HTML5.
<header>
<a href="javascript:commonSubmit('displayHomePage')"><img class="noBorder" src="images/logo.png" alt="Home" /></a>
<div id="nav">
...
In addition, in a large template-generated table, some information in certain cells would occasionally shift by a pixel or two. No changes were made to the styles on the pages, only altering the doctype caused this issue.
The only change in code that resulted in these shifts:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
After:
<!DOCTYPE HTML>