Search code examples
cssgoogle-chromehtml5boilerplate

Chrome doesn't respect the "visuallyhidden" class on tables


The visuallyhidden class, used by HTML5 Boilerplate, doesn't completely hide <table>s in Chrome.

.visuallyhidden
{
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

To clarify: the table is invisible in Chrome but it takes up physical space and can cause unwanted scrollbars etc.


Solution

  • Still not totally sure which part is causing problems for Chrome but setting display: block; is a good enough fix for my purposes.