As with tables, frames have many attributes you can use to alter their appearance within the Web browser. You can turn a frame border on or off, define frame margins, or disallow scrolling for a particular frame. The following sections show you how.
Borders
The frameborder attribute enables you to turn a border on or off. You can individually specify whether you want the frames within your frameset to have borders. Borders help your readers differentiate between frames, but they can also get in the way of a seamless page. The value of the frameborder attribute can be 1, to turn the border on, or 0 to turn the border off.
<frameset cols="20%,*">
HTML 4 for Dummies, 4th Edition
by Ed Tittel and Natanya Pitts ISBN:0764519956 John Wiley & Sons © 2003 (408 pages)
Whether your goal is to build a simple, text-oriented Web site or one loaded with frames, graphics, and animation, this step- by-step book will put you on the right track.
Table of Contents
HTML 4 For Dummies, 4th Edition Introduction
Part I - Meeting HTML in Its Natural Environment
Chapter 1 - The Least You Need to Know about HTML and the Web Chapter 2 - HTML at Work on the Web
Chapter 3 - Creating Your First HTML Page Part II - Getting Started with HTML
Chapter 4 - Structuring Your HTML Documents Chapter 5 - Linking to Online Resources Chapter 6 - Finding and Using Images
Chapter 7 - Top Off Your Page with Formatting Part III - Taking HTML to the Next Level
Chapter 8 - HTML Tables Chapter 9 - HTML Frames Chapter 10 - HTML Forms
Part IV - Extending HTML with Other Technologies Chapter 11 - Getting Stylish with CSS
Chapter 12 - HTML and Scripting Chapter 13 - Making Multimedia Magic
Chapter 14 - Integrating a Database into Your HTML Chapter 15 - How HTML Relates to Other Markup Languages Part V - From Web Page to Web Site
Chapter 16 - Creating an HTML Toolbox Chapter 17 - Setting Up Your Online Presence Chapter 18 - Creating a Great User Interface Part VI - The Part of Tens
Chapter 19 - Ten Ways to Exterminate Web Bugs Chapter 20 - Ten HTML Do’s and Don’ts
Part VII - Appendixes Appendix A - HTML 4 Tags
Appendix B - HTML Character Codes Appendix C - Glossary
Index
Cheat Sheet- HTML 4 For Dummies, 4th Edition List of Figures
List of Tables List of Listings List of Sidebars
<frame src="content.htm" frameborder="0"> </frameset>
Warning The default value for the frameborder attribute is 1. If you don't want borders around your frames, you have to use the frameborder attribute to turn them off (0).
Figure 9-8 shows the example site with borders turned off; Figure 9-9 shows it with borders turned on.
Figure 9-8: Borders turned off using frameborder="0".
Figure 9-9: Borders turned on using frame-border="1".
Margins
You can determine the margin height and width for any frame by using the following attributes:
marginwidth: Accepts a value of 1 or more pixels to determine the exact width of the left and right margins of a frame.
marginheight: Accepts a value of one or more pixels to determine the exact height of the controls at the top and bottom margins of a frame.
HTML 4 for Dummies, 4th Edition
by Ed Tittel and Natanya Pitts ISBN:0764519956 John Wiley & Sons © 2003 (408 pages)
Whether your goal is to build a simple, text-oriented Web site or one loaded with frames, graphics, and animation, this step- by-step book will put you on the right track.
Table of Contents
HTML 4 For Dummies, 4th Edition Introduction
Part I - Meeting HTML in Its Natural Environment
Chapter 1 - The Least You Need to Know about HTML and the Web Chapter 2 - HTML at Work on the Web
Chapter 3 - Creating Your First HTML Page Part II - Getting Started with HTML
Chapter 4 - Structuring Your HTML Documents Chapter 5 - Linking to Online Resources Chapter 6 - Finding and Using Images
Chapter 7 - Top Off Your Page with Formatting Part III - Taking HTML to the Next Level
Chapter 8 - HTML Tables Chapter 9 - HTML Frames Chapter 10 - HTML Forms
Part IV - Extending HTML with Other Technologies Chapter 11 - Getting Stylish with CSS
Chapter 12 - HTML and Scripting Chapter 13 - Making Multimedia Magic
Chapter 14 - Integrating a Database into Your HTML Chapter 15 - How HTML Relates to Other Markup Languages Part V - From Web Page to Web Site
Chapter 16 - Creating an HTML Toolbox Chapter 17 - Setting Up Your Online Presence Chapter 18 - Creating a Great User Interface Part VI - The Part of Tens
Chapter 19 - Ten Ways to Exterminate Web Bugs Chapter 20 - Ten HTML Do’s and Don’ts
Part VII - Appendixes Appendix A - HTML 4 Tags
Appendix B - HTML Character Codes Appendix C - Glossary
Index
Cheat Sheet- HTML 4 For Dummies, 4th Edition List of Figures
List of Tables List of Listings List of Sidebars
attributes to nicely separate the content in one frame from the content in another. Margins must be one or more pixels wide to keep objects from touching the edges of a frame. The marginwidth and
marginheight attributes are optional. If you omit this attribute, the browser sets its own margin widths (usually one or two pixels, depending on the browser).
To define the margin height or width, add the attributes to the frame elements:
<frameset cols="20%,*">
<frame src="navigation.htm" frameborder="0" marginwidth="20" marginheight="20">
<frame src="content.htm" frameborder="0" marginwidth="20" marginheight="20"> </frameset>