Skip to content
Related Articles

Related Articles

How to create a nested webpage in HTML ?

Improve Article
Save Article
  • Last Updated : 25 Aug, 2021
Improve Article
Save Article

When the content of one completely different webpage is embedded into another webpage, it is called a nested webpage. In simple words, a webpage that is inside another webpage of a completely different domain.

 In this article, we are going to learn how to create a nested webpage. There are two methods to create a nested webpage. They are as follows.

  1. Using <iframe> tag
  2. Using <embed> tag

1. Using <iframe> tag:

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

 

Syntax:

<iframe src="URL"></iframe>

It can take the height and width of the inline frame as attribute.

Example:

HTML




<!DOCTYPE html>
<html>
   <head></head>
   <body>
      <h1>
        Creating a Nested Webpage using 
        'iframe' Tag: Geeksforgeeks
      </h1>
  
      <iframe src="https://www.geeksforgeeks.org" 
              height="500px" width="1000px">
      </iframe>
   </body>
</html>

Output:

2. Using <embed> tag:

The <embed> tag in HTML is used for embedding external applications which are generally multimedia content like audio or video into an HTML document. But another raw HTML content can be embedded using this tag. We can use this feature to create a nested webpage.

Syntax:

<embed src="URL" type="text/html" /> 

Example:

HTML




<!DOCTYPE html>
<html>
   <head></head>
   <body>
      <h1>
        Creating a Nested Webpage using
        'embed' Tag: Geeksforgeeks
      </h1>
  
      <embed src="https://www.geeksforgeeks.org" 
          type="text/html" />
   </body>
</html>

Output:

The website can prevent you from embedding their content due to copyright issues. So it is mandatory to have proper permission and authorization before using another webpage as a nested webpage inside your website.


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!