By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,445 Members | 1,160 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,445 IT Pros & Developers. It's quick & easy.

positioning of blocks

P: n/a
Hi

I'm having some trouble positioning blocks
inside other blocks.

The way I understand it "position: absolute;"
means that the position is relative to the parent's
upper left corner. This doesn't seem to work if
the parent's position is set to static. In this case
the my inner block gets positioned relative to
the upper left corner of the page. Is this how it's
supposed to be?

regards
/Christoffer
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In article Christoffer Berg wrote:
The way I understand it "position: absolute;"
means that the position is relative to the parent's
upper left corner. This doesn't seem to work if
the parent's position is set to static.
By definition.
In this case
the my inner block gets positioned relative to
the upper left corner of the page. Is this how it's
supposed to be?


Yes.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #2

P: n/a
In article <bn**********@eol.dd.chalmers.se> in
comp.infosystems.www.authoring.stylesheets, Christoffer Berg
<d0*****@dtek.chalmers.se> wrote:
The way I understand it "position: absolute;"
means that the position is relative to the parent's
upper left corner. This doesn't seem to work if
the parent's position is set to static. In this case
the my inner block gets positioned relative to
the upper left corner of the page. Is this how it's
supposed to be?


Yes, the outer block needs to be "position:relative" to reset the
coordinates for the inner block.

Brainjar <http://brainjar.com/css/positioning/> explains this well,
I think. There's a link to it from my "Web Resources for Web
Authors", <http://oakroadsystems.com/tech/webauthr.htm>.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.