Aligning content to top of iFrame in IE

Discussion in 'CSS' started by mvdn, Apr 8, 2010.

  1. #1
    Ie is driving me mad (or my own ignorance)

    I have <div> and I load a HTML file into it.
    In FF, CHROME, Safari it loads right onto the top of the <DIV>, no whitespace visible.
    In IE (8.0) there is a margin (some 12 px) which I can't get rid of.

    I must be overlooking something, but what?
    All help very much appreciated!
     
    mvdn, Apr 8, 2010 IP
  2. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hi, can you post a link please
     
    ampg-it, Apr 8, 2010 IP
  3. mvdn

    mvdn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sorry, forgot...

    www.prince2leren.nu/test_index.html

    background <DIV> is GREEN

    background file I'm loading into iFrame is RED
     
    mvdn, Apr 8, 2010 IP
  4. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hi MVDN

    Add this style to your .thrColHybHdr #sidebar2

    padding: 0px;

    Any more problems let me know.
     
    ampg-it, Apr 9, 2010 IP
  5. mvdn

    mvdn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi Mark,

    Thanks for your advice. CSS looks like:

    .thrColHybHdr #sidebar2 {
    float: right;
    width: 260px;
    border: 1px solid #616194;
    height: 710px;
    margin: 2px;
    background-color: #6F0;
    top: 0px;
    padding: 0px;
    }

    But does not work.......
     
    mvdn, Apr 9, 2010 IP
  6. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi again,

    I've put it on the back of our site and it looks fine: http://www.ampg-it.co.uk/test.htm

    I did notice something else on line 86 of your code, you've got an extra quote mark, this might be causing problems.

    <td height="32" bgcolor="#CCCCCC" class="Blude-12pt-bold" ">Snel naar</td>
     
    ampg-it, Apr 9, 2010 IP
  7. mvdn

    mvdn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi Mark,

    Thanks for your efforts, but it gets real confusing now:
    when I open your test copy it works OK.
    So, except for the misplaced " did you change anything else??

    Mart
     
    mvdn, Apr 9, 2010 IP
  8. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    the only other thing I had to do was add the full url path for things such as iframe source, image paths, css paths, etc
     
    ampg-it, Apr 9, 2010 IP
  9. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Mart, did you remove the quote mark? because it's still there on your site.
     
    ampg-it, Apr 9, 2010 IP
  10. mvdn

    mvdn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Yes, it's gone
     
    mvdn, Apr 9, 2010 IP
  11. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hi Mart, you need to put line 86 back in, all you needed to do was remove the quote mark like this:

    <td height="32" bgcolor="#CCCCCC" class="Blude-12pt-bold">Snel naar</td>
     
    ampg-it, Apr 9, 2010 IP
  12. mvdn

    mvdn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    yes, but the <td> had to go anyway...
     
    mvdn, Apr 9, 2010 IP
  13. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    In that case remove the tr tags aswell
     
    ampg-it, Apr 9, 2010 IP
  14. mvdn

    mvdn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    yes, you're right (I'm good at producing sloppy code:)
    but still: baffling
     
    mvdn, Apr 9, 2010 IP
  15. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    yes it's very strange.

    Have you tried adding the full source path for the iframes? i.e.

    <iframe src="http://www.prince2leren.nu/dummy2.html"
     
    ampg-it, Apr 9, 2010 IP
  16. mvdn

    mvdn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    yes, and does not help
    (getting stranger and stranger....)
     
    mvdn, Apr 9, 2010 IP
  17. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Try copying all my code and replacing yours.

    You will need to change the path to the stylesheet
     
    ampg-it, Apr 9, 2010 IP
  18. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #18
    ** SIGH **, tables for layout AND an iFrame - and nobody takes him to task for either. When did we get to 1998?

    Much less that even if using tables for layout (which you shouldn't) this design only warrants the use of ONE table, not three - or that iFrames or regular frames are both a total accessibility /FAIL/ which is why there are very few cases where they should be used... that you are needing javascript to do two frames at once is just compounding the problems... then Spry menu to boot?

    IFRAME was deprecated for a REASON after all.

    Whoever told you this is how one builds a website needs a bitch-slap with a giant wet trout... as evidenced by the 11k of markup to deliver 516 bytes of content. I don't even want to THINK about what a disaster it will be with actual content plugged into it.
     
    deathshadow, Apr 9, 2010 IP
  19. mvdn

    mvdn Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Mark,

    solved it: the only difference was that in your code the css was loaded last, whereas in my code it was loaded first. Thanks a lot for your effort.
     
    mvdn, Apr 10, 2010 IP