[thelist] CSS opacity question

ben morrison morrison.ben at gmail.com
Wed Jul 11 12:07:13 CDT 2007


On 7/11/07, Barney Carroll <barney at textmatters.com> wrote:
> ben morrison wrote:
> > Using 'universally unambiguous css' how will the background div know
> > how wide/high it should be so that it will take up the same amount of
> > space as the foreground (content) div (also consider text resizing)?
> >
> > Generally we are taking about height as widths are more often used than heights.
>
> The trick is to give the parent relative positioning, and both children
> (content and background) absolute positioning (which makes them
> dependent on the closest relative parent), and top, right, bottom and
> left values of 0. They will both hug the edges of their parent.
>
> Because they are absolutely positioned there is no competition in the 2D
> flow of the page, and they can occupy the same horizontal and vertical
> space.

I have no problem understanding absolute & relative positioning, it
was more a question of the hugging the container as you put it - which
is quite useful.

ben
-- 
Ben Morrison
http://www.benjaminmorrison.com



More information about the thelist mailing list