160 likes | 290 Views
USING THE <iframe> TAG. CIS67 Foundations for Creating Web Pages Professor Al Fichera. iFrames. Reference for CIS127 and CIS 137. Floating Inline Frame. An inline frame (also called a floating frame), can be placed on the body of any Web page, similar to the way you would place an image.
E N D
USING THE <iframe> TAG CIS67 Foundations for Creating Web Pages Professor Al Fichera iFrames Reference for CIS127 and CIS 137
Floating Inline Frame • An inline frame (also called a floating frame), can be placed on the body of any Web page, similar to the way you would place an image. • An inline frame embeds another Web page within the scrolling area of the frame. Professor Al Fichera (All Classes, CIS67, 127, and 137)
The XHTML Tag <iframe> • The <iframe> tag configures an inline frame. • This is a special scrolling area that displays a different Web page document on the page. • This does not need to be a part of a frameset. • It can be placed on the body of any Web page. Professor Al Fichera (All Classes, CIS67, 127, and 137)
<iframes> Browser Support • Inline frames are supported by the most recent versions of Firefox, Safari, and MSIE • However, the older Netscape 4 Browser did not support inline frames. Professor Al Fichera (All Classes, CIS67, 127, and 137)
<iframes> and Assistive Technology • Inline frames are not universally supported by all Browsers and Assistive Technology such as screen readers, so use them with caution. • How can you be sure that you'll support Assistive Technology on a page using an iframe? • Place a hyperlink to the content that will be displayed in the iframe between the opening and closing <iframe> tags as seen in the next slide. Professor Al Fichera (All Classes, CIS67, 127, and 137)
The XHTML Code for iframe • The code for the inline frame looks like this: <iframe src="something.html" title="Something about something" height="?n in pixels" align="where I want it" name="something" width="?n in pixels"> Place a description of what the iframe holds here for Browsers that do not support iframes. <a href="something.html" target="_blank"> Something about something</a></iframe> • The <iframe> element is a container tag, and is always used with its closing </iframe> tag. • Notice how the closing tag wraps it all together. Professor Al Fichera (All Classes, CIS67, 127, and 137)
XHTML Elements in Common Use • The iframe shown here is using the most common elements in use, however, there are more elements that should be used. • This is letting the Browser take over, not my style!! <iframe src="something.html" title="A little Something" width="?n" /> </iframe> Professor Al Fichera (All Classes, CIS67, 127, and 137)
More Attributes for <iframe> • align="the options are below"left(default),center, or rightSpecifies the horizontal alignment for a floating inline frame (deprecated now, use CSS instead). • frameborder="options are 0or1"Determines whether borders should be displayed around this inline frame. Professor Al Fichera (All Classes, CIS67, 127, and 137)
More Attributes for <iframe> • height="number of pixels or percentage"Specifies the height of the inline frame object. • id="alphanumeric, no spaces"Provides a unique identifier for the inline frame. • longdesc="place a detailed text description of the iframe here" Professor Al Fichera (All Classes, CIS67, 127, and 137)
More Attributes for <iframe> • marginheight="number of pixels"Specifies the top and bottom margins of the inline frame. • marginwidth ="number of pixels" Specifies the left and right margins of the inline frame. • name="Alphanumeric, no spaces, begin with a letter"Configures the name of the inline frame; required when using the target attribute. Deprecated in XHTML but is used to provide backward compatibility for HTML Browsers. Professor Al Fichera (All Classes, CIS67, 127, and 137)
More Attributes for <iframe> • scrolling="options are"yes|no|auto(default)Specifies whether scroll bars are visible. Auto is the default and displays scroll bars as needed. • src="URL, the valid file name"Specifies the document or URL of the object to be displayed in the floating inline frame. Professor Al Fichera (All Classes, CIS67, 127, and 137)
More Attributes for <iframe> • title="text phrase that describes the inline frame"Sets the title of the inline frame and could be accessed by screen readers plus, is recommended by the W3C to improve accessibility. • width="number of pixels or percentage"Specifies the width of the inline frame. Professor Al Fichera (All Classes, CIS67, 127, and 137)
As Seen In: Firefox 3.6.13 Professor Al Fichera (All Classes, CIS67, 127, and 137)
As Seen In: Safari 5.0.3 Professor Al Fichera (All Classes, CIS67, 127, and 137)
As Seen In: MSIE 8.0.76 Professor Al Fichera (All Classes, CIS67, 127, and 137)