43 users online (0 members and 43 guests)  


  Results 1 to 6 of 6

Related

  1. Position:absolute problem    Forum: HTML Forum
    Replies: 0
  2. Absolute best way to design navigation.    Forum: Search Engine Optimization - SEO - Forum
    Replies: 0
  3. Absolute best way to design navigation.    Forum: HTML Forum
    Replies: 0
  4. Uploading and absolute hrefs?    Forum: General Discussion
    Replies: 2
  5. Setting an image to the absolute corner    Forum: HTML Forum
    Replies: 7
  1. #1
    Johnny™'s Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2004
    Location
    N.I.
    Posts
    3

    Unhappy iFrame positioning? do they always have to be absolute?

    Hello all!

    I'm using iFrames to hold a menu system and content on my website... www.ardmore.co.uk

    ATM it is positioned hard left. I would like to be able to position the page aligned middle to accomodate larger screen resolutions.

    I have a 21" monitor and when the browser is maximised the site looks lonely all the way up in the top corner.

    Is there anyway i can get my iFrames to hold their position in relation tho the other page elements, but get the site to align centrally when the browser page window is maximised???

    cheers

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Have you tried

    Code:
    <div align="center">
    
    ...ALL your content ...
    
    </div>
    ?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Johnny™'s Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2004
    Location
    N.I.
    Posts
    3
    Thanks Dean,

    yes i have tried this. I don't think iFrames behave as normal HTML content as they 'float' over other content and take their position, in pixel coordinates from the top left hand corner of the screen.

    I what i mean is... is it posible to make iFrames move with a point or image on the page when the browser is resized. ie they float with that point or image relative to their original position on stretching the browser window?.

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    This will happen if you use position: absolute. Have you tried position: relative? relative will not collapse the original space left by the iframe, and its position is always relative to where it would have been on the page naturally.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    Johnny™'s Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2004
    Location
    N.I.
    Posts
    3
    No i havent tried it, but i would if i knew how too?

    Have you any ideas? currently my frames are displayed as:

    <iframe id="content" name="content" style="position:absolute; left:615px; top:67px; width:148px; height:293px; z-index:1" frameborder="no" scrolling="no" src="content/content_about-us.htm">&nbsp;</iframe>
    thanks

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    If you change absolute to relative, then change your left and top values.

    The difference is that absolute reads the top and left from either the highest containing element (ie the body) or the containing element that has a position declared itself. But with relative, the values are read from where the element would be naturally. Try just changing the absolute, you should see what I mean.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread