ie remove the IFRAME border compatible ie7\ie8\ie6 below

Source: Internet
Author: User

"IE6 Below"
The IFRAME border is set by CSS in the normal under the FF under IE but there is still a border, through the IFRAME tag inside the Set property frameborder= "No" border= "0" can remove the nasty iframe border.
<iframe src= "url" id= "iframe" width= "0" height= "0" frameborder= "no" border= "0" ></iframe>

"Ie7ie8"
Encountered a depressed problem, ie8,ie7 iframe borders can not be removed, tried to use scripts and styles to add Frameborder,border properties can not be removed.
The setting is valid before the IFRAME append to the page, and there is no way to modify it after append. As follows:



The
code is as follows:


&lt;iframe id= "B" &gt;&lt;/iframe&gt;


&lt;!--&lt;iframe id= "B" frameborder= "0" &gt;&lt;/iframe&gt;--&gt;


&lt;script type= "Text/javascript" &gt;


var IFR = document.createelement (' iframe ');


ifr.setattribute (' frameborder ', 0); With me no border


Document.body.appendChild (IFR);


//ifr.setattribute (' frameborder ', 0); Use me to have border


Ifr.style.cssText = ' border:0 none; ';


&lt;/script&gt;


&lt;script type= "Text/javascript" &gt;


var div = document.createelement (' div ');


Document.body.appendChild (DIV);


div.innerhtml = ' &lt;iframe id= ' a ' &gt;&lt;/iframe&gt; '; Use me to have border


//div.innerhtml = ' &lt;iframe id= ' a ' frameborder= ' 0 ' &gt;&lt;/iframe&gt; '; With me no border


var IFR = document.getElementById (' a ');


ifr.setattribute (' frameborder ', 0);


Ifr.style.cssText = ' border:0 none; ';


&lt;/script&gt;


&lt;script type= "Text/javascript" &gt;


var IFR = document.getElementById (' B ');


ifr.setattribute (' frameborder ', 0);


Ifr.style.cssText = ' border:0 none; ';


&lt;/script&gt;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.