HTML and CSS Reference
In-Depth Information
Since it provides a fixed area to display the content within, an iframe can also be
used to display a large amount of content (text generally) in a confined area on the page.
For example, perhaps your website has a “terms and conditions” statement, which gen-
erally would be a long document filled with legalese text. The document is accessible
through a link in the footer at the bottom of your pages, but you also want to embed
this same document in a registration form for when a user registers on your site. Instead
of having a duplicate of the terms and conditions page on your site—both linked in the
footer and on a user registration form—you could embed the existing document into the
registration page, such as shown in Figure 5-4 .
Figure 5-4. Example of using an inline frame to embed an existing text-heavy document in a small
The source code for Figure 5-4 might look like this:
<label>Agree to Terms and Conditions <input
type="checkbox" title="Agree to Terms
and Conditions" /></label>
<iframe src="tnc.html" width="500" height="100">
<a href="tnc.html" target="_blank">View Terms and
New iframe element attributes
As far as the attributes of iframe go, there has been the usual practice of presentational
attributes being marked obsolete in HTML5. The following attributes should not be
Search WWH ::

Custom Search