An element with
visibility: hiddenvisibility: hidden hides an element, but the element still takes up space. Layout needs it, so it stays in the render tree.display: none is the tempting wrong answer. It removes the element from layout completely, so it is left out of the render tree. The <head> and <script> elements are left out too, because they are not visual.