Moving inner div to the bottom-right corner of the outer parent div

jessica

I would like my inner div to be on the bottom-right corner of the outer div, by using float: right, but for some reason, it'll staying on the bottom-left corner. What am I doing wrong?

#outer {
width:100%;
height:20%;
border: 1px solid black;	
position: absolute;		
}	
#inner {
width: 50px
height: 50px;
border: 1px solid red;
position: absolute;
float: right;		
bottom: 0;		
}
<div id = 'outer'>
<div id = 'inner'>
bottom-right corner;	
</div>	
</div>

Josh Crozier

Add right: 0 instead.

Floating the element won't have any effect on it if it's absolutely positioned.

#outer {
  width: 100%;
  height: 20%;
  border: 1px solid black;
  position: absolute;
}
#inner {
  width: 50px height: 50px;
  border: 1px solid red;
  position: absolute;
  bottom: 0;
  right: 0;
}
<div id='outer'>
  <div id='inner'>
    bottom-right corner;
  </div>
</div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Moving an div from the top left corner to bottom right using css

From Dev

Quotes in top-left and bottom-right corner of div

From Dev

How to display two inner divs at the bottom of an outer div

From Dev

How to display two inner divs at the bottom of an outer div

From Dev

Outer Div not expanding with Inner Div

From Dev

Outer Div not expanding with Inner Div

From Dev

How can I make a inner-div fixed on the bottom of outer-div, so it moves when the outer-div expands

From Dev

Calculate bottom left corner of a div

From Dev

How to set a div's position inside another div to bottom right corner?

From Dev

positioning div to bottom of parent div

From Dev

Div in bottom of parent with spacing?

From Dev

Aligning div to bottom of parent

From Dev

Span at the bottom of Parent div

From Dev

Margin of inner Div affects outer div

From Dev

Outer div background is overlapping inner div

From Dev

applying style to inner div on hover of outer div

From Dev

Inner div affected by outer div's onclick

From Dev

outer div content going inside of inner div

From Dev

Fix the width for inner div same as outer div

From Dev

Make inner div match height of outer div

From Dev

make inner div wider than the outer div

From Dev

Inner Div with larger width than outer div

From Dev

CSS Outer Div Moves with Inner Div

From Dev

Make inner div match height of outer div

From Dev

make inner div wider than the outer div

From Dev

outer div content going inside of inner div

From Dev

How to fit inner div inside an outer div

From Dev

CSS Inner Div Fill Outer Div

From Dev

Skewed background div positioned to the content block's right hand bottom corner

Related Related

HotTag

Archive