Loading Please Wait...

Logo Lynxsia IT Solutions

HTML Iframes

HTML Iframes

Iframes display webpage inside webpage.

Iframes are helpful in displaying content from another source such as another website, YouTube videos, etc.

<iframe> Element

The <iframe> tag is used to embed an iframe. The src attribute is used to define the URL/Path of the resource.

Let's see with some example
					 
        
          <!DOCTYPE html>
          <html>
            <body>
              <iframe src="https://lynxsia.com/" title="Lynxsia IT Solutions Website"></iframe>
            </body>
          </html>
        
      
It is best practice to write title attribute for the iframe. It helps browser or screen readers to understand the content of the iframe.
Iframe Size

To define the size of the iframe use width and height attribute.

You can also define the size of the iframe using CSS Style.

Let's see with some example
					 
        
          <iframe src="https://lynxsia.com/" title="Lynxsia IT Solutions Website" width="300" height="300"></iframe>
          <br>
          <iframe src="https://lynxsia.com/" title="Lynxsia IT Solutions Website" style="width: 300px; height: 300px;"></iframe>
        
      
Iframe Border

To define the border of the iframe use border CSS Style. You can also remove the border.

Let's see with some example
					 
        
          <iframe src="https://lynxsia.com/" title="Lynxsia IT Solutions Website" style="border: 2px solid #ffddaa;"></iframe>
          <br>
          <iframe src="https://lynxsia.com/" title="Lynxsia IT Solutions Website" style="border: none;"></iframe>
        
      
Iframe As Link Target

We can also open a link into an Iframe.

Use name attribute of the iframe to define target for the link.

Let's see with some example
					 
        
          <iframe src="" name="demoFrame" style="width: 300px; height: 300px;"></iframe>
          <br>
          <p><a href="https://lynxsia.com/" target="demoFrame">Open Link in iframe</a></p>
        
      
YouTube Video

To link YouTube video, use YouTube video URL as src attribute.

Let's see with some example
					 
        
          <iframe src="https://www.youtube.com/embed/E7El1JsxuCA" title="Hotel Management System Demo"></iframe>
        
      
In src "https://www.youtube.com/embed/E7El1JsxuCA", "https://www.youtube.com/embed/" is the base URL and "E7El1JsxuCA" is the id of the video.

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved