
HTML
HTML Head
HTML Forms
HTML Graphics
HTML Media
HTML APIs
HTML Iframes
The HTML iframe embeds external HTML content within the designated area of the current webpage. These include videos, maps, or a webpage.
HTML Iframe Tag
The <iframe> tag is used to specify the URL of the external content that is embedded inside the HTML document. The tag allows the developers to integrate external resources into the document seamlessly.
Pro Tips:
- Always style the <iframe> with CSS. Example
- Always add a title attribute for the HTML iframe. It helps the reader know what the content is about.
HTML Iframe Attributes
Height and Width: Height and width attributes specify the iframe’s size.
Name:The name attribute is used to specify the name of the iframe.
Remove the Border: Use the CSS border and style attribute to remove the default border around the iframe. Additionally, with CSS you can customize the iframe border in the desired size, color, and style.
Target for a Link: The target iframe attribute can target a particular frame for a link. Remember, the target attribute of the embedded link must refer iframe’s name attribute.
Allow Full Screen: Set the ‘allowfullscreen‘ attribute to true to allow the users to activate full-screen mode anytime.
Loading: This HTML iframe attribute specifies whether the iframe will load immediately in a browser or take some time until the conditions are met.
HTML iframe offers versatility, allowing the integration of external resources into a webpage. Understanding iframe and its attributes is essential to using them properly and improving the functionality of a web page.