SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2009
    Location
    Ontario, Canada
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <iframe> height issue and negative margins

    I'm trying to display an entire page in an iframe which looks exactly how I want it if I statically set the height in pixels. Then I want to hide the footer on that page so I use a negative margin. The problem is that the iframe content is not controlled by myself and changes in height with dynamically generated content. I've tried setting height to 100% but this doesn't seem to work. All this does is show like 200px of the content when the entire page is over 2000px long.

    How do I go about showing a static width iframe with a full 100% height with a -100px bottom margin and no scrolling allowed?

    Here is my current code:

    Code HTML4Strict:
    <iframe src="[redacted]" width="312px" height="100%" scrolling="no" frameborder="no">
      <p>Your browser does not support iframes.</p>
    </iframe>
    Last edited by Ryan Mortier; Nov 29, 2011 at 14:41. Reason: redacted personal information

  2. #2
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you sure about using iframes. As i know google dose not like them and you might be sandboxed. Make sure i might be wrong. Search in google about iframes.
    Last edited by Stevie D; Nov 29, 2011 at 15:59. Reason: Fake sig removed

  3. #3
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,088
    Mentioned
    256 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by nomanzia View Post
    As i know google dose not like them and you might be sandboxed.
    Nonsense. Google itself uses iframes to allow users to embed its maps into other sites.

  4. #4
    SitePoint Zealot
    Join Date
    Nov 2009
    Location
    Ontario, Canada
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not worried about indexing as it's an internal use site. I'm more concerned about getting it to actually work. Maybe I should be asking in the CSS forum?

  5. #5
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,088
    Mentioned
    256 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by Ryan Mortier View Post
    Maybe I should be asking in the CSS forum?
    That's probably the best idea - ask for the thread to be moved. I don't normally use iframes, so I'm not much help here. I believe there are some limitations on styling iframes. I suppose height:auto doesn't work?

  6. #6
    SitePoint Zealot
    Join Date
    Nov 2009
    Location
    Ontario, Canada
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    I suppose height:auto doesn't work?
    Just gave that a try with no success. I'll try to contact someone to move the thread to the CSS forum.

  7. #7
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should try this code:
    http://www.sitepoint.com/forums/show...=1#post5058771

    See example 2. It fixes the height problem. You can add a footer aswel.
    You can style your scrollbars as you like.

  8. #8
    SitePoint Zealot
    Join Date
    Nov 2009
    Location
    Ontario, Canada
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your suggestion but what I ended up doing was scrapping iframes altogether. I used PHP with the cURL extension to pull the information I wanted from the site and then used PHP DOM class to structure it with my own HTML and CSS.


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
  •