Open In App

HTML <iframe> align Attribute

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

Syntax



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

Attribute Values

Note: The HTML

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






<!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: 


Article Tags :