Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/259659-positioning-div-in-bottom-right-corner/
Share on other sites

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;	
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.