[Techtalk] CSS absolute positioning and overflow:hidden

Shirrell shirrell at pstat.com
Sun Oct 1 20:10:48 UTC 2006



Akkana Peck wrote:

>Shirrell writes:
>  
>
>>It you place a style section before the </head> which contains something 
>>like:
>>
>><style
>>one { position: absolute: left:150px; top:10px; }
>>two { position: absolute: left:450px: top:10px; }
>></div>
>></style>
>>
>>and then use somethinkg like:
>>
>><img class="one" src="flower1.gif"  alt=""/>
>><img class="two" src="flower2.gif" alt=""/>
>>
>>the images appear inside the containing box.
>>    
>>
>
>Any idea why it behaves differently when the absolute coordinates
>are in a <style> tag versus when they're attached to the image
>directly?
>  
>
I think I now understand: Quoting from the "Complete Reference" by 
Thomas Powell.

"Typically, absolute positioning uses the upper-left corner of the 
browser as the origin,
but if posiitoned objects are within positioned regions themselves, 
their origin is the
top-left most coordinate of their container.

The containing box in your html is not absolutely positioned and if you 
do position it
you then have to worry about positioning what follows.  

>Using the page style like that sounds a lot harder for a dynamic
>JavaScript page. Is it even possible to change page style (as
>opposed to changing the style of one specific element) from
>JavaScript?
>  
>
I don't use much JavaScript -- HTML with CSS1 and CSS2 does most of what 
I need

>  
>



More information about the Techtalk mailing list