The only type of frames in general use today are iframes. These enable you to update a
page section without reloading the rest of it. Popular sites using iframes include
Newstoday (www.newstoday.com/) and Pixelsurgeon (www.pixelsurgeon.com/), the latter
of which uses a small inline frame to display its news feed.
In a more general sense, this can be handy for enabling users to update a portion of a
site’s design without touching the rest of the design, and without resorting to a costly content
management system. However, there are superior and more accessible alternatives to
this system, as you’ll see later in the chapter.
An iframe can be placed anywhere within a web page. Its available attributes are outlined
in Appendix A (XHTML Reference), but two worth mentioning here are width and height,
which define the dimensions of the iframe. Set these with caution, because it’s annoying if
an iframe is bigger than the viewable area, or if the content of the iframe is too big for its
defined dimensions. Note that these attributes can be omitted from HTML and instead
defined in CSS (by way of an iframe tag selector or by applying a class to the iframe).
Here’s some example code for an iframe:
<iframe src="internal_news.html" name="news" width="200" height="200"
å scrolling="yes" frameborder="0">Your browser doesn't support
å iframes. Please <a href="internal_news.html">click here
å to see the iframe's content</a>.</iframe>
Note the succinct content for the iframe, which enables non-frames-compatible devices to
directly access the content of the iframe—compliant devices ignore this.
No comments:
Post a Comment