3.3 Iframes
An HTML iframe is used to display a web page within a web page.
Iframe Syntax
An HTML iframe is defined with the <iframe> tag.
The src attribute specifies the URL(web address) of the inline frame page.
Iframe - Set Height and Width
Use the height and width attributes to specify the size of the iframe. The height and width are specified in pixels by default:
Iframe - Remove The Border
By default an iframe has a border around it. To remove the border, add the frameborder attribute and set it to 0.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>iframes</title> </head> <body> <iframe src ="images.html" width ="200px" height="150px" frameborder="1"></iframe> <br> <iframe width ="560" height ="315" src = "https://www.youtube.com/embed/sCtixpIWBto" frameborder="0"></iframe> </body> </htm>
Copyright © 2021 Code 4 Tomorrow. All rights reserved.
The code in this course is licensed under the MIT License.
If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact classes@code4tomorrow.org for inquiries.