10

What is an iframe, and how is it used in html?

wazz
5,0885 gold badges22 silver badges36 bronze badges
asked Jun 5, 2010 at 9:51
2
  • 2
    Is searching really so difficult these days? google.com/search?q=iframe. I'm wondering if this is even a serious question. Commented Jun 5, 2010 at 10:00
  • 1
    I believe this is a valid question. Check out: meta.stackexchange.com/questions/8724/… which may indicate stackoverflows objective. If anything, you might get a better reponse from html questions at doctype.com . Maybe one day we will be telling people to 'just stackoverflow it' but until then we need to continue compiling real answers. Commented Jun 5, 2010 at 10:28

4 Answers 4

12

An iframe is an object that allows you to embed external content in your HTML page. You can use it to display other web pages, documents (e.g. PDF) etc (although for complex media types you may want to try the object tag instead).

You can add an iframe to your page like so:

<iframe src ="externalContent.html" width="400" height="300">
 <p>Your browser does not support iframes.</p>
</iframe>

The p tag inside will display if iframes are not supported by the browser being used.

answered Jun 5, 2010 at 9:54
Sign up to request clarification or add additional context in comments.

Comments

0

The iframe element denotes an inline frame, simple as that.

Example usage:

<iframe src="foo.html">
 <p>Your browser does not support <code>iframe</code> elements.</p>
</iframe>
answered Jun 5, 2010 at 9:55

Comments

0

Example of iframe - https://jsfiddle.net/vsaurabhaec/jsgbncf0/

Example with url :

<iframe src="https://www.findertoday.com/address-finder/address/Bhagatpur+Tea+Garden-9953?width=500&access_method=findertoday" target="_parent" width="500" height="270" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>

Example with content :

<iframe id="FileFrame" src="about:blank">
<html><body>test</body></html>
</iframe>

NB : iframe need some security awareness. css and js does not have control over inner part of iframe and this is advantage of iframe ( some time )

answered Sep 12, 2017 at 17:47

Comments

0

An iframe is an HTML element that allows an external webpage to be embedded in an HTML document.

In other words, it’s a website within a website. It’s like embedding a chrome or firefox tab within a page, except that it doesn’t have any toolbars or an address bar or anything visible other than the web page that’s loaded. This allows developers to load one web page within another without the user necessarily knowing that they are separate pages. An iframe may load something as simple as a single like button to an entire web page or documents like pdf and many more.

For example

<iframe src="https://www.birthdaycalculatorbydate.com" width="600px" "height="800px" align="center" scrolling="yes"></iframe>

Original content is from iframeinhtml.com

answered Aug 27, 2020 at 4:13

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.