Thursday, December 27, 2007

Difference between Visibility & Display in CSS

CSS has two properties for hiding the contents. Those are

1. Visibility
values: inherit visible hidden ;
2. Display
values: block none inline list-item ;

Both Visibility and Hidden are used to hide the information, but when you use Visibility to hide, browser still takes up the space in layout and displays blank space.

Whereas if you use Display to hide the information, browser will removes the element completely from the document and it doesn't show any blank space in that location, even though the HTMl for it is still in the source.


Use : Using these properties you can create effects of collapsible panel.

No comments: