Hi all, I'm quite new to Html and Css so i hope some one can help me. the problem is pretty simple. i have a large div box ( a container) And inside this i have 3 smaller Div boxes. i try to position them using absolute position, thinking that since they are inside the container code wise, the upper left corner of the container would be (0,0). my problem is that when i run the page the positioned box is moved outside the container. what am i doing wrong? i have listed the body of my html and the id of a single div. hopes this is sufficient. using dtd strict <!--HTML--> <body> <div id="main"> <div id="Logo"></div> <div id="Menu"></div> <div id="Content"></div> </div> </body> <!-- CSS--> #Content { height:299px; width:100px; background-color:red; position: absolute; right: 10px; top: 120px; }
Well, for starters you are trying to use absolute positioning instead of float/flow order. What I THINK your actual 'problem' is relates to that absolute positioned elements are 'removed from flow' - meaning that as far as the container they are in 'source-wise' is concerned they do not exist for determining the dimensions.
you are trying to absolute position the child elements within the parent element, right? first do this in the main #main {position: relative} then you can absolute position anything within the parent element