Home arrow Style Sheets arrow Page 4 - Introduction to CSS Positioning Properties Part 2
STYLE SHEETS

Introduction to CSS Positioning Properties Part 2


In this second part of a two-part article, we examine more positioning properties available in the CSS2 specifications, and use what we've learned to build a simple drop-down menu without employing any JavaScript.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 10
February 28, 2005
TABLE OF CONTENTS:
  1. · Introduction to CSS Positioning Properties Part 2
  2. · The "clear" property
  3. · The "z-index" property
  4. · The "visibility" property
  5. · The "overflow" property
  6. · A simple drop-down menu using the "overflow" and "display" properties

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Introduction to CSS Positioning Properties Part 2 - The "visibility" property
(Page 4 of 6 )

This property is utilized for controlling whether an element is visually rendered on a document. By assigning the values "visible" or "hidden" to the element, it's possible to display it or hide it from view. However, if the element is hidden, it will preserve the space in the document where it's normally visualized. It's valid to mention that this property must not be interpreted as the "display" property, since this last one will remove completely the element from the document and the document space won't be preserved at all.

As stated above, the possible values for this property are the following:

visibility: visible;

Sets the selected element to be visible on the document.

visibility: hidden;

Sets the selected element to be hidden on the document. The original space occupied is preserved.

visibility: collapse;

Internet Explorer does not support this value.

visibility: inherit;

When the value "inherit" is assigned, it implies that if the parent element is hidden, then the child element will be hidden too. However, if the child's visibility is set to "visible," the parent element's visibility will remain hidden, so you can manipulate the child element in an independent way.  Here's a simple example for this property:

<style type="text/css">

#element1 {

     position: absolute;

     width: 500px;

     top: 200px;

     left: 100px;

     visibility: hidden;

}

</style>

The example shows an element that will be initially hidden from view. However, the space corresponding to the element in the document will be preserved.

Finally, we'll see our last CSS property for visual positioning, which wraps up this short guide for CSS2 positioning: the "overflow" property. 


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials