CSS: the auto value of the top property

I first found this technique in a useful article on CommunityMX and I decided to make some tests that I didn't publish because they only show what has already been said several times since now. Finally I decided to publish more advanced tests that you can find here. Anyway, the top property accepts an auto value like all the other positioning properties. The interesting thing here is that if the absolutely positioned elements follow a static element in the source, then the absolutely positioned element will be put exactly under the static element. Remember, however, that this technique works only if a static element comes first in the source. You may use this technique in several possible scenarios, for example to display a navigation bar under a title or image captions inside a box where you need a finer control over the default positioning of caption text. It's only a matter of choice and particular needs.

2 thoughts on “CSS: the auto value of the top property”

Leave a Reply

Note: Only a member of this blog may post a comment.