Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML <iframe> align Attribute

  • Last Updated : 29 Sep, 2021

The HTML <iframe> align attribute is used to specify the alignment of the inline-frame according to the alternate element. 

Syntax

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<iframe align="left|right|middle|top|bottom">

Attribute Values

  • left: It sets the alignment of an iframe to left.
  • right: It sets the alignment of an iframe to right.
  • middle: It sets the alignment of an iframe to the middle.
  • top: It sets the alignment of an iframe to the top.
  • Bottom: It sets the alignment of an iframe to the bottom.

Example: Below HTML code demonstrates the use of align attribute in the <iframe> element. 



HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML iframe align Attribute
    </title>
  
    <style>
        .left {
            text-align: left;
        }
  
        .right {
            text-align: right;
        }
    </style>
</head>
  
<body style="text-align:center;">
  
    <h1>GeeksforGeeks</h1>
  
    <h2>HTML iframe align Attribute</h2>
    <b>
        <p class="left">left-align</p>
  
    </b>
  
    <iframe align="left" src=
        height="200" width="250">
    </iframe>
    <b>
        <p class="right">right-align</p>
  
    </b>
  
    <iframe align="right" src=
        height="200" width="250">
    </iframe>
</body>
  
</html>

Output:

Supported Browsers: 

  • Google Chrome
  • Internet Explorer
  • Opera
  • Apple Safari
  • Firefox



My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!