The Wayback Machine - https://web.archive.org/web/20240718023947/https://www.geeksforgeeks.org/remove-border-from-iframe-using-css/
Open In App

Remove border from IFrame using CSS

Last Updated : 04 Dec, 2018
Improve
Suggest changes
Post a comment
Like Article
Like
Save
Share
Report

The Iframe is used to display a web page on the webpage. 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. The value taken by the frameBorder property are 0 and 1, where 0 is used to disable the border and 1 is used for enabling the border property. By default, the value is set to 1.

Example 1:




<!DOCTYPE html>
<html>
    <head>
        <title>Disable Iframe Border</title>
        <style>
            iframe {
                height:200px;
                width:400px;
                background-color:lightgreen;
            }
            h1 {
                color:green;
            }
            body {
                text-align:center;
            }
        </style>
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2>iframe border property</h2>
  
        <!-- We do not use border by specifying value 0 -->
        <iframe src=# frameBorder="0"></iframe> 
    </body>
</html>                    


Output:

Example 2:




<!DOCTYPE html>
<html>
    <head>
        <title>Disable Iframe Border</title>
        <style>
            iframe {
                height:200px;
                width:400px;
                background-color:green;
            }
            h1 {
                color:green;
            }
            body {
                text-align:center;
            }
        </style>
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2>iframe border property</h2>
  
        <!-- We use border by specifying a non-zero value -->
        <iframe src=# frameBorder="1"></iframe> 
    </body>
</html>                    


Output:



Previous Article
Next Article

Similar Reads

How to load a hyperlink from one iframe to another iframe ?
HTML Iframe or inline frame allows embedment of multiple HTML pages in an HTML page. In this article, we will see how to change the content of one iframe using hyperlinks in another iframe. This can be achieved by the proper usage of the name attribute in the iframe tag and the target attribute in the anchor tag. The name attribute allows each inli
2 min read
How to check if an iframe is present in another iframe in JavaScript ?
In this article, we will see how to check if an iframe is present in another iframe, along with understanding its basic implementation with the help of a simple example. An iFrame is an HTML element that allows users to embed a webpage within another webpage. It's frequently used for displaying content from another website, such as a video or a soc
4 min read
How to Add an Iframe Border using CSS ?
This article will show you how to add a border to the iframe element using CSS. An inline frame is used to embed another document within the current HTML document. To add the iframe border, we will use the CSS border property. Syntax: &lt;!-- CSS border to the iframe --&gt;&lt;style&gt; iframe { border: 5px solid green; }&lt;/style&gt;&lt;!-- HTML
1 min read
Dynamically Create and Remove Iframe in JavaScript
JavaScript allows us to dynamically add and remove elements to the document. We can use event listeners and special JavaScript methods to create and remove HTML elements. This article focuses on creating and removing iframe elements dynamically using JavaScript. Let's first create a basic structure of the document using buttons and other elements.
2 min read
How to remove border from an editable element using CSS ?
Given an HTML document containing some document and the task is to remove border from an editable element using CSS. It is a default behavior of any element which have content-editable attributes set to true whenever, the element gets a focus it will get a border around them. The task can be done by using the [attribute] selector to select all elem
1 min read
Which one should we use 'border: none' or 'border: 0 '?
In this article, we will learn the validity of CSS border properties. We can specify the no border property using CSS border: none, border-width : 0, border : 0 properties. Syntax: border: none | 0 Differences: border: noneborder : 0For this property, the browser does not render.For this property, the browser renders border-color and border-width p
1 min read
How to apply CSS property to an iframe ?
An iframe is the short form of inline frame. By using iframe tag, you can display another webpage content into a HTML page document in a rectangular shape structure. The webpage content can be any video, another website, any image and so on. This iframe also has scrollbars and borders for good look and feel of the document. Syntax: &lt;iframe src="
4 min read
How to insert HTML content into an iFrame using jQuery?
Here is the task to insert HTML content into an iFrame using jQuery. To do so, we can use the jQuery contents() method. The .contents() method: It returns all the direct children, including text and comment nodes for the selected element. Syntax: $(selector).contents()Find the iframe in the body section.Get the value to be inserted in the iframe in
2 min read
How to change the width of an iframe to 100% using JavaScript ?
In this article, we are given an HTML document containing an &lt;iframe&gt; element and the task is to change the width of the &lt;iframe&gt; element to 100% with the help of JavaScript. There are two methods to change the width of the iframe which are discussed below: Method 1: This method uses the id attribute of iframe with width property to cha
2 min read
How to set height of an iframe element using HTML ?
The iframe in HTML stands for Inline Frame. The "iframe" tag defines a rectangular region within the document in which the browser can display a separate document, including scrollbars and borders. An inline frame is used to embed another document within the current HTML document. The HTML &lt;iframe&gt; height attribute is used to specify the heig
1 min read
three90RightbarBannerImg