This shows how Javascript and the DOM , combined with CSS can hide or show parts of an HTML page individually, or en masse.
Here's pop up window 1.
This paragraph has a link to a pop-up hidden with "display:none". This paragraph is followed by 2 paragraphs which are hidden with "visibility:hidden".
This is the first invisible paragraph.
This is the last invisible paragraph.
Any change to the "display" property forces the browser to reformat the document. So it's a little slower.
"Visibility" renders more quickly, since the browser makes room for it on the virtual canvas only once when it first renders the page. For non-static elements, it's a good strategy.
Unless.
If you display PRE elements in your popups — computer code, for instance — and need to fiddle with "overflow" to manage horizontal viewing of wide content, then in Firefox your page may wind up a little distorted. Static elements above or below the invisibile element will often appear wrinkly (off by 1px in horizontal alignment) where they intersect the borders of the invisible element.
Display avoids this issue, since "display:none" removes the element from the virtual canvas entirely.
The gap above illustrates one of the trade-offs with the "visibility" property. If "position:static" elements are hidden through their "visibility" property, the browser still reserves space for them, as above. Any static element remains in "normal flow".
If you apply "visibility:hidden" to "position:absolute" or "position:fixed" elements this isn't a problem. Elements with these positions are taken out of normal flow and placed above or below static elements.
Here's a brief note comparing "visibility" and "display".