I have the following:
Code:<div> <a><img><span>text 1</span></a> <a><img><span>text 2</span></a> <a><img><span>text 3</span></a> </div>A row of three images appears. When the links are hovered over, a span appears underneath the row of images, in the div. If the images are of different heights, the span still appears in the same place, because the containing block of the span is the div (position:relative, whereas the anchor is static).Code:div { position:relative; } div a span { position:absolute; display:none; } div a:hover span { display:block; }
However, if I add this:
Suddenly the spans start appearing absolutely positioned in relation to the anchor and not the div. According to this great article, a containing block is one positioned absolutely, relatively or fixed. It says nothing about floats.Code:div a { display:block; float:left; }
Can someone clarify?







Bookmarks