Quick Contact

    HTML iFrame

    Introduction

    An iframe, also known as an inline frames, is used to show external items such as other web pages inside a web page. An iframe is essentially a small web browser within a web browser. Furthermore, the material contained within an iframe exists independently of the surrounding components.

    Syntax

    < iframe src=”URL“>< /iframe>

    The src property specifies a URL that links to the location of an external object or a web page.

    Example

    < !DOCTYPE html>
    < html lang="en">
    < head>
    < title>HTML iFrame< /title>
    < /head>
    < body>
    	< iframesrc="https://tutorials.ducatindia.com/">< /iframe>
    < /body>
    < /html>
    

    Output

    HTML iFrame

    Setting of Width and Height of iFrame

    The height and width parameters are used to determine the iframe’s height and width.

    Example

    < !DOCTYPE html>
    < html lang="en">
    < head>
    < title>Specify iFrame Dimensions in HTML< /title>
    < /head>
    < body>
    < h2>Showing Width and Height Using Attributes< /h2>
    < iframesrc="https://tutorials.ducatindia.com/" width="400" height="100">< /iframe>
    < hr>
    < h2>Showing Width and Height Using CSS< /h2>
    < iframesrc="https://tutorials.ducatindia.com/" style="width: 400px; height: 100px;">< /iframe>
    < /body>
    < /html>
    

    Output

    HTML iFrame

    Removing Default Frameborder

    By default, the iframe has a frame around that. However, if you want to change or delete the iframe boundaries, you need utilise the CSS border attribute.

    The example below just renders the iframe without any boundaries.

    Example

    < !DOCTYPE html>
    < html lang="en">
    < head>
    < title>Removing Borders from iFrame Using CSS< /title>
    < /head>
    < body>
    < iframesrc="https://tutorials.ducatindia.com/" style="border: none;">< /iframe>
    < /body>
    < /html>
    

    Output

    HTML iFrame

    Using an iFrame as Link Target

    An iframe can also be used as a destination for hyperlinks.

    The name property may be used to identify an iframe. This means that whenever a link with this same name as a target variable is clicked, the associated resource will open in that iframe.

    FAQS

    Q1. Are IFrames still used?

    iFrames are an HTML element that has been around for a long time, having been established in 1997. Regardless of their antiquity, they are still widely used and supported by all current browsers.

    Q2. What is difference between iframe and frame?

    A frame is used to separate a page into many portions, each containing different information. To eliminate cross-site scripting difficulties, an iFrame is utilized to integrate the contents of external websites inside the web page.

    Q3. What is an iframe URL?

    An iFrame, commonly known as an Inline Frame, is a web page element which imports another HTML element. They are widely used to embed particular material into the website, such as external advertisements, movies, tags, and other interactive features.

    An iFrame, also knowns as Inline Frame, is an element that loads another HTML element inside of a web page. They are commonly used to embed specific content like external ads, videos, tags, or other interactive elements into the page

    Q4. How iframe is used in HTML?

    In HTML, iframe stands for Inline Frame. The “iframe” element specifies a rectangular zone within the content where the browser may show a distinct document, complete with scrollbars and borders. An inline frame is a type of frame that allows another page to beembedded into the current HTML text.

    Copyright 1999- Ducat Creative, All rights reserved.

    Anda bisa mendapatkan server slot online resmi dan terpercaya tentu saja di sini. Sebagai salah satu provider yang menyediakan banyak pilihan permainan.