Download presentation
Presentation is loading. Please wait.
Published byAsher Caldwell Modified over 9 years ago
1
HTML Frames
2
Advantages to Using Frames n flexibility in design n information in different Web pages n remove redundancy. n site easier to manage. n update only a few files rather than the whole. n Web designers create both framed and non-framed versions for a Web site and give users the option of which one to use.
3
Disadvantages to Using Frames n The browser has to load multiple HTML files –increasing wait time n Some older browsers cannot display frames. n Some users do not like using frames. n Some web authors feel that frames are too constricting. n Frames can use up valuable screen space. n The source code is hidden.
4
Creating a Frame Layout The tag is used to store the definitions of the various frames in the file. These definitions will typically: –include the size and location of the frame –include the Web pages the frames display The code does not include an opening and closing tag. –the reason for this is that this HTML file displays the contents of other Web pages; technically, it is not a Web page
5
Specifying Frame Size and Orientation n For frame layout –use rows and cols attributes of n frameset is defined by rows or columns, but not both. n Must choose to layout frames in either rows or columns.
6
The Frame Syntax n The syntax for creating a row or column frame layout is: – row height is the height of each row or – column width is the width of each column
7
Frames Defined in either Rows or Columns This figure shows frame layouts in either rows or columns.
8
Row and Column Sizes n Row and column sizes can be specified in three ways: –in pixels –as a percentage of the total size of the frameset –by an asterisk (*)
9
Columns Example n This frameset was created by the following code:
10
Rows Example n This frameset was created by the following code:
11
Defining Rows and Columns Using an Asterisk (*) n The asterisk instructs the browser to allocate any unclaimed space in the frameset to the particular row or column. –for example, the tag creates two rows of frames. Specify at least one of the rows or columns of your tag with an asterisk to ensure that the frames fill up the screen. n You can use multiple asterisks. n The browser divides the remaining display space equally among the frames with the asterisks. –for example, the tag creates three rows of frames with equal heights.
12
Frames of Different Sizes This figure shows frames of different sizes. 160 pixels wide25% of the width of the display area whatever space is left
13
Example n
14
Creating Two Rows of Frames tag creates two rows of frames: the first 85 pixels high and the second occupying the remaining display area
15
Specifying a Frame Source To specify a source for a frame, use the tag with the syntax: n The URL is the filename and location of the page that you want to load. You must insert the tag between the opening and closing tags.
16
The Tag n Defines the content in each frame n Placed between the tags n The src attribute specifies the file that will appear in the frame n In the following example, the page that will appear in the top frame is the file fl-toc.html, and the page that will appear in the lower frame is fl-second.html.
17
Nesting Tag n Remember that a frameset is defined by rows or columns, but not both. n To create frames using both rows and columns, one frameset must be nested inside another. n The interpretation of the rows and cols attributes changes slightly.
18
Controlling the Appearance of Your Frames n You can control three attributes of a frame: –scroll bars –the size of the margin between the source document and the frame border –whether or not the user is allowed to change the size of the frame
19
Setting the Border Color n To change the color of a frame’s border, use the bordercolor attribute. The attribute can be applied either to an entire set of frames, using the tag, or to individual frames, using the tag. n The syntax for this attribute is: – or – –color is either a color name or a color value
20
Thank You n Thank you
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.