by
Paul Mendoza
4/30/2007
I'm not an expert in using CSS but I can get around for the most part but the other day I needed to hide a section of a document with some Javascript and CSS. My problem was that when I'd use the property
visibility: hidden;
The content that was inside the hidden div tag would disappear but would still take up space on the screen. So then I found the CSS 2 collapse tag for use with tables.
visibility: collapse;
But the problem with this is that it's not supported in IE6 and that it also requires using tables. The nice thing about the collapse property is that it hides the content inside the tag but also causes the space that the content used to take up to disappear.
But to get around this and have a tag hide it's contents and not take up space on a page, use
display: none;
To show the tag again, use
display: inline; or display:block;
Tags:
Categories: