Paul Mendoza C# blog
Monday, April 30, 2007
  CSS 2 collapse property and how to not use it
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

visibility: hidden;
display: none;

To show the tag again, use

visibility: visible;
display: inline;
 
Comments: Post a Comment





<< Home
I am currently an ASP.NET, C# developer working on MangosteenNation.com, a XanGo website for helping people build their businesses. I am also pursuing a degree at CSU San Marcos in Southern California.

XanGo at Mangosteen Nation

Archives
October 2005 / November 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / April 2007 / May 2007 / June 2007 / August 2007 / February 2008 / August 2008 /


Powered by Blogger

Subscribe to
Posts [Atom]