Advanced Search

Results 1 to 7 of 7

Thread: Horizontal or Side-by-side iframes

  1. #1
    Join Date
    Apr 2005
    Location
    Sydney, Australia
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Horizontal or Side-by-side iframes

    I can't get my IFrames to sit side by side, they go down the page.
    I've tried adjusting the width using percentages as I don't want to use a fixed width (but will if I have to)

    Is there any other way than using a table?

    the solution needs to be compatible for both Firefox and IE (latest versions)

    thanx
    WIWAG

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,680
    Thanks
    43
    Thanked 3,126 Times in 3,092 Posts
    Blog Entries
    12

    Default

    <iframe style="display:inline"></iframe><iframe style="display:inline"></iframe>

    Should work (along with whatever other attributes you want to give them) as long as they are not too wide to fit.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2005
    Location
    Sydney, Australia
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    What's too wide to fit?

    I'm using percentages as the width (is that legal?) so it should just take up whatever width is available?
    ie. width=30% and %70
    This works in IE, but not in FF.(latest versions)

    thanx
    WIWAG

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,680
    Thanks
    43
    Thanked 3,126 Times in 3,092 Posts
    Blog Entries
    12

    Default

    Try 28% and 68%, or even slightly less, to allow for the fuzzy math of Mozilla.

    Also, a link to the page or its code would help.

    I just did an experiment and 29.9% with 70% for the other was good for blank iframes.
    Last edited by jscheuer1; 05-04-2005 at 05:33 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Newbie Question

    I tried your suggestion but obviously I'm not doing it correctly, because it didn't work.

    I have 3 iframes for Amazon ads:


    <iframe src="http://rcm.amazon.com/e/cm?t=livercom-20&o=1&p=8&l=as1&asins=0969527225&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

    <iframe src="http://rcm.amazon.com/e/cm?t=livercom-20&o=1&p=8&l=as1&asins=0969527217&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

    <iframe src="http://rcm.amazon.com/e/cm?t=livercom-20&o=1&p=8&l=as1&asins=3981050215&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>


    They already use style= so I suppose there is a conflict when I add another style, but I don't know the syntax of the code for using 2 styles.

    Here's the url: http://www.livercancercurenow.com/ca...dwig-protocol/

    Thanks for helping a newbie!

    Rick.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,680
    Thanks
    43
    Thanked 3,126 Times in 3,092 Posts
    Blog Entries
    12

    Default

    Your 'problem' is the br tag (whose function is pretty much solely to create a line break) -

    The first iframe is followed by 4 br tags (from your source code):

    Code:
    <br />
    <br /></br><br />
    So is the second. The third has only 3:

    Code:
    <br />
    <br /></br>
    The third one doesn't really matter in this case though, you want a line break there.

    Different browsers will treat this differently. All will give at least one line break if there are one or more br tags. Some may in some cases give more than one line break when there is more than one.

    In any case, getting rid of the 8 br tags which follow the first two iframes (4 apiece), will cause all three iframes to line up horizontally, which I believe is what you are after.
    Last edited by jscheuer1; 07-02-2010 at 02:31 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    rickghouse (08-03-2010)

  8. #7
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thanks, John!

    Wow, I happened to come back to this post a month later, and here's my answer.

    It worked beautifully.

    Thanks very much, John!

    Rick.

Bookmarks

Posting Permissions

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