Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fix DIV to bottom right corner

Tags:

css

background

I have used html and body attributes to have a gradient background and a flower background for my website.

I have also used a div to have the bottom right hand flower where it is. Works great, but not when scrolling. How do i get the bottom right hand corner image to stick to the bottom of the screen ?

like image 839
user195257 Avatar asked Nov 08 '09 19:11

user195257


People also ask

How do I move a div to the bottom right corner?

To place a div in bottom right corner of browser or iframe, we can use position:fixed along with right and bottom property value assigned to 0.

How do I fix a div on the right side?

if a div is fixed or absolute you can use right: 0; to get the div to the right.

How do you get a div to stay at the bottom of the page?

Set the position of div at the bottom of its container can be done using bottom, and position property. Set position value to absolute and bottom value to zero to placed a div at the bottom of container.


2 Answers

You will want to set position: fixed; instead of position: absolute;.

Here's more info on the Position Property.

.bottomright {       position: fixed;       bottom: 0px;       right: 0px;  }    .demo {       background-color: HotPink;       padding: 20px;       margin: 5px;  }
Hello<br>    <div class="demo bottomright">     I'm a Div!  </div>    there
like image 67
stephenhay Avatar answered Oct 01 '22 21:10

stephenhay


if you put the flower inside a div and position it absolute bottom and right this will stick it there.

For example, something like this will work

#mystylename{      position:absolute;      bottom:0;      right:0; } 

you may need to tweak it to get it sat where you want and also maybe add a z-index

like image 21
Joe Morris Avatar answered Oct 01 '22 22:10

Joe Morris