Last active
December 16, 2017 19:20
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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