How to Add a Close Button to an IFRAME
IFRAMES allow Web developers to create sites within websites. For example, by adding a simple IFRAME tag to your Web page, you can show site visitors a live webcam from another site or even a page from one of your own sites. IFRAMES do not have menus or buttons. To close an IFRAME object, you must add a "Close" button to your Web page and create a close event to hide the IFRAME.
Open Notepad or your HTML editor and create a new document.
Add this HTML code to the document:
Save the HTML document. Open your browser and load that doument. The IFRAME containing the Whitehouse website will appear below the "Close This Iframe" button.
Tips & Warnings
- In this example, the IFRAME's "src" tag causes the IFRAME to show the Whitehouse website. Change the "src" value to the URL of any site on the Internet to display that site in the IFRAME.