Skip to content

Instantly share code, notes, and snippets.

@pguerrant
Last active December 16, 2017 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pguerrant/4666558 to your computer and use it in GitHub Desktop.
Save pguerrant/4666558 to your computer and use it in GitHub Desktop.
Webkit border-collapse bug. Table is missing bottom border if it has border-collapse: collapse, box-sizing:border-box, overflow:hidden and is absolutely positioned
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<style>
table {
border-collapse: collapse;
border-spacing: 0;
border: 25px solid green;
position: absolute;
top: 100px;
left: 100px;
overflow: hidden;
box-sizing: border-box;
outline: 1px solid blue;
}
td {
padding: 0;
}
div {
height: 50px;
width: 50px;
background-color: red;
}
</style>
<table id="table">
<tbody>
<tr>
<td>
<div></div>
</td>
</tr>
</tbody>
</table>
<script>
document.write('<p>table height - ' + document.getElementById('table').offsetHeight + '</p');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment