[thelist] positioning a DIV nested within an A

Ben Yates byates at emich.edu
Tue Sep 14 14:40:22 CDT 2004

>Well, you can't nest a DIV inside an A, so you're off on the right foot.
Oops.  Changed to a span (with display: block).

The idea is to have the interior span far, eyeball-wise, from its parent 
A; they'll still be linked via rollovers.  It's easiest just to look at 
the link:


I've positioned them using pixels, but this won't do at all -- the page 
layout is fluid, and I want their position to change with the window 
size.  Easy enough to do normally -- just specify right: 20px (or 
however far from the right side of the screen) but in this case they 
insist on measuring from the right edge of the parent element -- the a 
tag -- rather than the right edge of the topmost ancestor element.  (One 
possible fix I've thought of is to redefine the menu width, and hence 
the a tag width, in terms of percentages, then define the span position 
in (absurdly large -- 1000%?) percentage terms as well: the menu will 
expand and contract, and therefore so will the span.  This'll play havok 
with my layout, though, and may not work at all, so I haven't tried it yet.)

More information about the thelist mailing list