UrbanDweller Posted March 25, 2012 Share Posted March 25, 2012 Hey, I have a parent div where i would like to place a child div inside it, positioned in the bottom right corner. The child div will be a button that make the parent div change size so I was wondering the simplest way to always position the child div in the bottom right corner no matter what the size is. I am using js to modify the css and will used to change the size of the parent div. Current method ideas: float: right; top: 200px; top: 200px; left: 200px; I have a function that can get the top left positioning but less code the better so if there's a simpler way with float etc Im all ears! Quote Link to comment Share on other sites More sharing options...
joel24 Posted March 25, 2012 Share Posted March 25, 2012 .parent { position: relative; } .child { position: absolute; bottom: 0; right: 0; } Quote Link to comment Share on other sites More sharing options...
UrbanDweller Posted March 25, 2012 Author Share Posted March 25, 2012 Hey thanks for that I tried it but due to me have a div inside div inside a div making they all fit inside is becoming hard. My current css looks like so.. //Div 1 Parent Div #imgDiv { position: relative; background-color: #999; background: #CCC; z-index: 0; } // Div 2 child of Div 1 #cropDiv { position: absolute; top: -1px; left: -1px; border: solid 1px #000; z-index: 1; } // Div 3 child of Div 2 #moveDiv{ position: absolute; height: 10px; width: 10px; border-left: solid 1px #000; border-top: solid 1px #000; } Quote Link to comment Share on other sites More sharing options...
haku Posted March 25, 2012 Share Posted March 25, 2012 Without the HTML, the CSS tells us very, very little. Quote Link to comment Share on other sites More sharing options...
ki Posted March 28, 2012 Share Posted March 28, 2012 How do you make it so that the div positioned moves with the page as you scroll down? Quote Link to comment Share on other sites More sharing options...
Who8MyFish Posted March 28, 2012 Share Posted March 28, 2012 Put everything in here and post us the link after you update (aka save) http://jsfiddle.net/ Your css appears to be legit but the HTML surrounding the css is super important. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.