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
- 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.
Note: The HTML
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





Please Login to comment...