www.webdeveloper.com
Results 1 to 4 of 4

Thread: IFRAME border showing in IE7

  1. #1
    Join Date
    Feb 2004
    Location
    London UK
    Posts
    248

    IFRAME border showing in IE7

    Hi guys I have aproblem with an IFRAME
    How can I turn off ALL the borders in IE7
    firefox and IE6 was easy with CSS but not in IE7
    If you want I can show you code

  2. #2
    Join Date
    Nov 2006
    Posts
    28

    Lightbulb border-width: 0; border-color: (same as bg)

    I'd like to see some code.

    Normally I'd use border-width: 0px but as we know IEx (especially 6) has extremely odd quirks with CSS, so idk if this will work the way you want.

    You could also try setting the border-color: to the same color as the background of the page. Just to be safe I'd do both, so if it ignores one it should still get the other.
    Code:
    body {
    background-color: #FFFF00;
    }
    iframe.noborder {
    border: solid #FFFF00 0px; 
    }

  3. #3
    Join Date
    Feb 2004
    Location
    London UK
    Posts
    248

    resolved Solution-ish

    OK I have fixed my border problem
    I also found another problem, that is with the fact that XHTML strict 1.0 dosn't allow IFRAMES so, instead u have to use the mighty <object> tag.

    Firefox was fine with said tag but a JavaScript call from inside the page needed to call a script from the parent document using "parent.blah" bugerred up in IE
    reason:

    IE7 has a bug that won't let it use the parent object when a page is in an <object> tag :-(

    So after allot of muttering four lettered words directed at a certain computer company, I have got a solution to both my probs: -

    HTML Code:
    		<!-- GUESS WHAT: IE DOSN'T HAVE GOOD ENOUGH SUPPORT FOR THE OBJECT TAG TO REPLACE IFRAME TAGS :-(
    		SO WE HAVE TO USE THIS MICROSOFTY STYLE HACK TO GET IT WORKING WITH A
    		NON-STANDARD IFRAME, AND YES THE FRAMEBORDER IS NEEDED FOR IE7 COMPATIBILITY! -->
    		<!--[if IE]><iframe id="frameUpload" src="upload.php?uploadTo=download&amp;r=<? echo rand() ?>" style="height:70px; width:70px" frameborder="0">
    		</iframe>
    		<![endif]-->
    		<!-- NOW THE CORRECT WAY OF DOING THINGS -->
    		<!--[if !IE]> <-->
    		<object id="frameUpload"
    		  data="upload.php?uploadTo=download&amp;r=<? echo rand() ?>"
    		  style="height:70px; width:70px; border-style:none" type="text/html"></object>
    		<!--> <![endif]-->
    As you can see it uses the proprietary if ie comment thingy to process an old-school IFRAME with a frameborder attribute and still allows me to have half-decent markup.

    Please note that I am attaching a random number to the query string for the url for the sub-page, this is to work around browser chaching issues (mostly IE again).

    P.s. this is used for a file upload withing an AJAX project and it work pretty damn good!

  4. #4
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,217

    Thumbs up

    Very good info. Thanks for taking the time to post your solution.

    Ron

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles