Results 1 to 2 of 2

Thread: keep object centered, How?

  1. #1
    Join Date
    Apr 2006
    Posts
    1

    keep object centered, How?

    i need to keep an iframe centered (in middle of screen) even when the page scrolls up or down. pls be as specific as posible, i am new to web development. thanx much. jim fitz

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    Three methods are available but you will have to abandon the iFrame unless you put it in a div according to the coding below. Anything fixed will mean other content will scroll behind it and be hidden.

    Coding most of the page as position: relative with floats but the centre part as position: absolute and stated px for left and top will usually make it stay in one place while the rest scrolls.

    Position: fixed is the best solution but IE6 does not support this. IE7 and Firefox do.

    See also
    http://tagsoup.com/-dev/null-/css/fixed/ (scroll and watch the left image)
    http://www.exclipy.com/css/imageoverlay/ (image overlay which stays in fixed position - works in Firefox but I can't see the effect in IE).

Similar Threads

  1. Target for Hyperlink in Object
    By Wickham in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 17 Feb 2006, 11:28 AM
  2. Problems with OBJECT tag linking in IE
    By RevThwack in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 03 Nov 2005, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •