Working with HTML Frames The Good, The Bad & The Ugly
Frames Overview Method of dividing the browser window into two or more sub-windows Creating a framed page is like specifying a “blueprint” for a house No content is specified in the HTML script that creates a framed page Use frames only when absolutely needed
Frames – A Blessing & A Curse Can detract from message conveyance Can be distracting if not used correctly Can be used to organize information Can be used for consistency
Frame Basics No … Container Individual framesets can only be specified in rows or columns, but never both Nested framesets are okay to use (allows us to use both rows and columns in the same page)
Frame Syntax - Container that acts as a “blueprint” in which all frames are specified Can be specified only in rows or columns, but never both Can contain nested framesets Several attributes Syntax: …
Attribute: border Specifies the frame border thickness between frames Takes a value in pixels Syntax: Found In: Found In:
Attribute: bordercolor Specifies the border color Takes color names or hex values Support for this attribute is limited Syntax: Found In: Found In:
Attribute: cols Specifies how the frameset is to be built – using columns Establishes both number of columns and their sizes Sizes can be specified in relative or absolute measurements Syntax: Found In: Found In:
Attribute: rows Specifies how the frameset is to be built – using rows Establishes both number of rows and their sizes Sizes can be specified in relative or absolute measurements Syntax: Found In: Found In:
Attribute: frameborder Specifies whether or not a 3-D separator will be added between frames IE and Navigator differ in frameborder values: IE takes “1” for yes and “0” for no Navigator takes “yes” or “no” Syntax: Found In: Found In:
Frame Syntax - Independent tag that defines a single frame Helps define the content of a frame Found nested within … Several attributes Syntax:
Attributes: bordercolor & frameborder Same purpose as the same attributes found in … Same syntax: Found In: Found In:
Attribute: name Gives a frame a name Required for referencing that frame as a target in hypertext references Syntax: Found In: Found In:
Attribute: src Specifies the source of the HTML file initially loaded into a given frame Required Can take absolute or relative pathnames Syntax: Found In: Found In:
Attribute: src Specifies the source of the HTML file initially loaded into a given frame Required Can take absolute or relative pathnames Syntax: Found In: Found In:
Attribute: marginwidth Specifies the amount of space between the left and right edges of a frame and the frame contents Specified in pixels Syntax: Found In: Found In:
Attribute: marginheight Specifies the amount of space between the top and bottom edges of a frame and the frame contents Specified in pixels Syntax: Found In: Found In:
Attribute: noresize Specifies that the user will not be able to resize a frame Needs only to be specified once in an individual frameset Takes no values Syntax: Found In: Found In:
Attribute: scrolling Specifies whether or not a scrollbar appears in a frame Three possible values: yes no auto Syntax: Found In: Found In:
Attribute: longdesc Specifies a link to a document containing a text description of a frame Used for non-visual browsers Syntax: Found In: Found In:
Frame Syntax - Container that defines content for browsers that do no read frames Found after tag No attributes Syntax: Your browser does not support frames. Upgrade or die a slow, painful death!
Nesting Framesets
Targeting Frames Target frames using the standard anchor tag - Target is defined in content pages only, not in … Uses the target attribute target attribute identifies the frame’s name
Targeting Frames Syntax: Open page in main frame!
Targeting Frames Reserved target values: _blank _self _parent _top Syntax: Open page in a new window!
Using the tag Allows you to specify a “default” target for all links in a document Saves a lot of typing Found in the … Syntax:
Questions?