Wednesday, 21 August 2013

Div not positioning correctly relative to parent div

Div not positioning correctly relative to parent div

precodelt;div
style=margin-top:30px;padding-left:auto;padding-right:auto;gt; lt;div
style=background:orange;position:relative;gt; lt;div
style=position:absolute;width:75px;left:120px;gt; lt;img
src=http://www.placehold.it/75x75 style= /gt; lt;/divgt; lt;/divgt;
lt;/divgt; /code/pre pFor some reason, the innermost div with the image
element does NOT want to respect its container div. The /p blockquote
pleft:120px/p /blockquote pproperty takes as reference the left side of
the browser window, NOT the container div's left border. What am I
missing? /p

No comments:

Post a Comment