In this conclusion to a three-part series on how to use absolute positioning in CSS, you'll learn how to build an easily customizable drop-down menu with this frequently under-appreciated feature.
Absolute Positioning in CSS: a Dynamic Menu (Page 1 of 4 )
While at first glance it seems that absolute positioning in CSS is doomed from the very beginning to be neglected because of its limited functionality on a dynamic canvas like the web, the truth is that it can be really helpful when coupled with its counterpart, relative positioning. Yes, as you may already know, the clever (and sometimes tricky) combination of these features allows developers to create engaging user interface elements on web pages without the burden of CSS floats or the difficulties that JavaScript offers to the average web designer.
Of course, this would be only empty words if I didn't show you how to utilize the relative/absolute tandem in a truly useful fashion, right? In consonance with this idea, in previous installments of this series I demonstrated how to appeal to this handy combination to create some basic (yet functional) tooltips. I also showed you how to place a quick search form within the heading section of a sample web page without using a single floated div.
These examples proved two relevant facts: first, that absolute positioning (at least when attached to a relatively-placed parent) is quite functional; and second, that it can be used in multiple and creative ways. This implies that the feature can be also utilized for building more complex user interfaces, including dynamic menus in all of their flavors and types.
In this last chapter of the series I’m going to illustrate how to build a drop-down menu using the aforementioned CSS tandem, which you’ll be able to customize and tweak at will with minor hassles.
Does this sound appealing enough for you? Then don’t waste more time in preliminaries; begin reading right now!