I am working on a client's site that was built using XHTML 1.0 Transitional. I'm changing it to HTML5.
I run into a problem when I switch the Doctype declaration to HTML5 however: table cells acquire top and bottom padding of about 2px.
But here's the strange thing: it isn't padding! While it displays as padding (green) in Chrome's Developer Tools, the Metrics section of DT clearly shows that there isn't any padding.
So if it's not padding, what is it? And where does it come from?
I've tried zeroing everything but to no avail.
HTML:
<DOCTYPE html>
<html>
<table>
<tbody>
<tr>
<td><a href="/somepage1">Link</a></td>
<td><a href="/somepage2">Link</a></td>
<td><a href="/somepage3">Link</a></td>
<!-- etc etc -->
</tr>
</tbody>
</table>
</html>
CSS:
table, tbody, tr, th, td {
margin: 0px;
border: 0px;
padding: 0px;
border-collapse: collapse;
border-spacing: 0;
}
td {
line-height: 20px;
vertical-align: middle;
border-spacing: 0;
}
a {
display: block;
width: 50px;
height: 20px;
margin: 0px;
padding: 0px;
background: url(somebackground-image);
}
I tried copying everything over to jsFiddle but I couldn't recreate the issue.