Hiding in Practice

In the following example, this exact technique is used to create an “additional information” type box.

Used for Dropdown Menus

This same technique can be used for to create dropdown menus.

The following code is one solution to creating a horizontal menu with a dropdown. Notice in line 33, that the content is hidden. Lines 47-49, cause the menu to be displayed, and lines 32-62 are used to present and style the dropdown menu.

Please study the following code to understand it better. You should also download the code and play with it via the links under the example.