iframe problem, centering contents

Discussion in 'HTML & Website Design' started by monkeyclap, Aug 22, 2009.

  1. #1
    how to go about centering the contents within an IFRAME, and not the IFRAME itself relative to the page.
    so for example if i used width="300" the iframe would be 300px width from the left handside. how do i change it so it's from the center instead?
    thanks in advance for your help!
     
    monkeyclap, Aug 22, 2009 IP
  2. DesignSamples

    DesignSamples Banned

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you can't - iframes merely deliver another complete html file into the available area. The orientation is top left by default.

    - You can offset this but it will not be cross browser compliant by any means.

    I don't know what you are using the iframe for, but if it is snippet of info - try ## including a small txt file then style it with your css for full control...
     
    DesignSamples, Aug 22, 2009 IP
  3. AssistantX

    AssistantX Peon

    Messages:
    173
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Your question and your example seem to be referring to two different things.

    As said before me, you cant change the content of a website inside a frame in anyway way. You can move the iframe itself to be placed in the center of your page by setting the parent element of the iframe to "text-align: center;".
     
    AssistantX, Aug 22, 2009 IP
  4. monkeyclap

    monkeyclap Active Member

    Messages:
    836
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    85
    #4
    ok thanks guys, decided not to use an iframe. cheers for help
     
    monkeyclap, Aug 23, 2009 IP