Jump to content

Positioning Div in bottom right corner.


UrbanDweller

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.