Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to position a div in bottom right corner of a browser?

I am trying to place my div with some notes in the bottom right position of the screen which will be displayed all time.

I used following css for it:

#foo {      position: fixed;      bottom: 0;      right: 0; } 

It works fine with Chrome 3 and Firefox 3.6 but IE8 sucks...

what can be a suitable solution for it?

like image 425
KoolKabin Avatar asked Sep 01 '10 09:09

KoolKabin


People also ask

How do you position a div at the bottom right of the page?

Optional : bottom right If you want to position the div to bottom right, you should add right : 0; .

How do I move a div to the right end?

If you want to move the div container, make sure the container is set as position "relative." Then adding style="float: right;" will work. If you want to only move the div within that container, then you need to use float="right" on that particular element (object) instead of positioning it with a style.

How do I put an image in the bottom right corner in HTML?

You can use position: fixed; bottom: 0px; right: 0px; which makes sure that your company logo is always visible at bottom right corner - this means that page scrolling is not affecting its position.


1 Answers

This snippet works in IE7 at least

<!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>Test</title> <style>   #foo {     position: fixed;     bottom: 0;     right: 0;   } </style> </head> <body>   <div id="foo">Hello World</div> </body> </html> 
like image 108
sewa Avatar answered Oct 03 '22 23:10

sewa