Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the best way to make a floating image?

Status
Not open for further replies.

sc123

IS-IT--Management
Feb 13, 2002
89
0
0
US
Should I use Iframe, CSS float, Div layering or something else to accomplish the following, and what code should be used?

I want to have a graphic "float" in the bottom left hand corner of the browser window (just like the feedback image at It will overlap tables, graphics, code and other content already programmed in standard HTML. I need the graphic to be able to be a link.
Thanks!
-SC
 
Depends on the browser support you're looking for. If it is standards-compliant browsers (Mozilla, Opera, Safari), then use CSS to do this. If it is the others (IE), resort to Javascript. Iframe or floating won't do, because those are still fixed elements on the page and do not move. The css solution would be:
Code:
<div style="position: fixed; right: 10px; top: 10px; width: 50px; height: 50px; background: red;">Fixed</div>
This will work how you want it in standards-based browsers. For IE, look for solution in Javascript forum:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top