Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Competely removing an <iframe> border

Tags:

html

css

Does anybody know how to completely remove an iframe border? I am using Firefox 3.x and the iframe is set to completely occupy the browser window - height="100%" width="100%"

I have already set frameBorder="0" and scrolling="no" but there is some space remaining at the border between the window and the iframe. Is the problem with 100% width and height? Do I need to set more than 100%? By how much?

like image 825
KJ Saxena Avatar asked Nov 12 '10 20:11

KJ Saxena


People also ask

How do I hide an iframe border?

Remove border from iframe tag in the webpage could be done by using one of the CSS properties of the iframe tag called frameBorder and set its value to “0”. Syntax: frameBorder = "value"; Note: In the frameBorder property the B letter must be in capital otherwise it will not be recognized by the browser.

How do you remove a border in HTML?

We can specify the no border property using CSS border: none, border-width : 0, border : 0 properties.

How do I remove an iframe tag?

Use prevAll() to get the iframe and remove using remove() method. $('head'). prevAll('iframe'). remove();

How do I get rid of side borders?

On the Design tab, choose Page Borders. In the Borders and Shading dialog box, in the Apply to list, choose the page (or pages) you want to remove the border from. Under Setting, choose None. Select OK.


2 Answers

Do you mean the margin/padding?

In the html file your iframe is displaying try the following CSS:

body {
    margin: 0;
    padding 0;
}

edit: It could also be similar for your iframe element itself. If the above doesn't work, in the parent html page try:

iframe {
    padding: 0;
    margin: 0;
}
like image 84
Hardeep Avatar answered Sep 28 '22 02:09

Hardeep


This worked for me by disabling border to iframe tags :

iframe {
    border:none;
}
like image 40
Alexander Avatar answered Sep 28 '22 02:09

Alexander