Web Design Stuff
HTML Tutorials    CSS Tutorials    Web Hosting   Resources
Create a Web Page 101
Making Web Pages Intro What is a Web Page? Why Make a Web Page? The History of HTML Learn HTML or XHTML?
Basic HTML
Basic HTML Tutorials Basic HTML Necessities How to Make a Web Page How to Edit a Web Page The Basics of HTML Tags Basic HTML Page Structure HTML Attributes
HTML Font Codes
HTML Font Codes Intro HTML Font Color Codes HTML Font Size Codes HTML Font Style Codes HTML Bold/Italic Codes Combining Font Codes
Formatting Text
Formatting Text Intro Making Paragraphs Miscellaneous Formatting Headings & Subheadings Creating Hyperlinks
Using Graphics
Using Graphics on the Web Add Graphics to Your Pages Graphics and Accessibility How to Align Graphics Page Color & Background Graphics as Hyperlinks Horizontal Rules
Creating Tables
HTML Tables Tutorials HTML Table Fundamentals Background & Border Color Table Frames & Rules Table Width and Alignment Cells 1 -Space & Alignment Cells 2 -Row Column Span Cells 3 -Width & Height
Making Lists
HTML Lists Tutorials Bulleted Lists Numbered Lists Definition Lists
HTML Frames
HTML Frames Tutorials Using Frames for Layout Advanced Frame Layouts Putting Hyperlinks in Frames Frame Border Width Color, Margin and Control Problems with Frames SmartFrames: A Solution SSI: An Alternative to Frames
Web Page Forms
Making Feedback Forms A Simple Feedback Form Installing NMS FormMail Debugging Your Setup My Web Host is Out to Lunch User Input Components Text Fields Checkboxes & Radio Buttons Dropdown Menus Push Buttons Layout and Presentation
Basic CSS
Basic CSS Tutorials What is CSS? Why You Should Use CSS How to Use CSS Inline Styles Embedded Style Sheets External Style Sheets Class Selectors ID Selectors Combining Selectors
CSS Properties
CSS Properties Intro Font Styles Width, Height & Spacing Borders Backgrounds Position Float & Alignment Hyperlinks
All About Web Hosting
Hosting Your Own Website What is a Web Host? Your Website's Home Page Building a Website Offline About Free Web Hosting Best Free Web Hosting Commercial Web Hosting How to Get a Domain Name Ecommerce Web Hosting Web Hosting Terminology
Free Web Design Tools
Best Free Website Tools Best Free Text Editors Best Free Graphics Editors Free Website Analysis Tools
Setting Up HTML Kit
HTML Kit Introduction How to install HTML Kit Screenshot Breakdown Basic Configuration Overall Appearance Shortcuts and Startup Editing Window Customizing Toolbars Using the Favorites Tab Making a New Actions Bar Odds and Ends
Free Templates
Free Website Templates Two Column Fixed Width Three Column Liquid Layout Miscellaneous Templates Dynamic Menu Effects Two Column Experimental Terms of Use About These Templates
Website Templates Help
Getting Started Template Zip File Download How to Edit Your Template What to Edit in the HTML How to Add Your Logo Making a Website
Web Design Tips
Web Design Basics Tables vs. Tableless Using Tables for Layout Example Table Layouts World's Crappiest Web Page
Twitter Backgrounds
Twitter Backgrounds Intro Cool Twitter Backgrounds Cool Twitter Backgrounds 2 Plain Twitter Backgrounds Dark Twitter Backgrounds Best Twitter Backgrounds Cute Twitter Backgrounds Music Twitter Backgrounds Music Twitter Backgrounds 2 Twitter Backgrounds 101 TERMS OF USE
All About Web Browsers
What is a Web Browser? Mozilla Firefox Internet Explorer Opera How to Set Up Firefox Top 5 Firefox Extensions
 
Contact
Post Some Feedback Send Me An Email Iron Spider Blog About Iron Spider... Site Conventions
 
 
 

 

Color, Margin and Control

 
Alright then, so far we've learned how to make basic and advanced frame layouts, how to make hyperlinks in frames and how to adjust the border widths in frames. Now let's round out our frame rendering skills by learning how to add some color and how to tweak some of the user controls.

We'll start with color. (All the examples below will be a modification of the advanced frame layout discussed in more detail on a previous page.)


Background Color


Rendering the background color of each frame in your frame layout is a no-brainer. To do this, you have only to adjust the background color of the frame source document loaded into the frame. For more information, see Page Color and Background.

Here's our advanced frame layout using a background color for the header and site menu frames.

Here's the same except with no borders. As you can see, this is already a vast improvement on the default appearance of the advanced frame layout.


Frame Border Color


You can adjust the color of the borders in your frame layout by using the bordercolor attribute in either the <frameset> or <frame> start tags. When used in the <frameset> tag, bordercolor affects the borders of all frames in that particular frameset. When used in the <frame> tag, bordercolor affects only the borders in that particular frame. The value can be any valid color expression.

Let's take the previous example and modify the source code so that it will display a 10 pixel black border in the top frame only:


<html>

<head>
<title>HTML Frames - An Advanced Frame Layout</title>
</head>

<frameset rows="20%,80%" framespacing="10" border="10">

<frame src="headercolor.htm" bordercolor="black">

<frameset cols="25%,75%" frameborder="no">
<frame src="menucolor.htm" name="menu">
<frame src="chapter1.htm" name="content">
</frameset>>

</frameset>

</html>



Here's what it looks like.


NOTES:
  • Since the frameborder attribute is omitted in the primary <frameset> tag then the default is frameborder="yes" (all frame borders are rendered). The framespacing="10" attribute/value pair renders a 10 pixel border in Internet Explorer and Opera while the border="10" attribute/value pair renders a 10 pixel border in Gecko-based browsers.
  • The bordercolor="black" in the first <frame> tag renders the top frame row border black in Internet Explorer and Gecko-based browsers (bordercolor is not supported in Opera).
  • The frameborder="no" attribute/value pair in the nested <frameset> tag turns off all frame borders in the bottom frame row (which is split into two columns).

Setting Margins


You can set the margins in each frame by using the marginwidth and marginheight attributes in your <frame> tags. The marginwidth attribute will set the amount of white space to be displayed on the left and right side of your frame's contents while the marginheight attribute sets the amount of white space to be displayed on the top and bottom. The value is a number specifying the width or height in pixels.

We'll build upon our previous example by setting all margins of the content frame. The top and bottom margins will be set to 30 pixels while the left and right margins will be set to 50 pixels.

Here's the source code:


<html>

<head>
<title>HTML Frames - An Advanced Frame Layout</title>
</head>

<frameset rows="20%,80%" framespacing="10" border="10">

<frame src="headercolor.htm" bordercolor="black">

<frameset cols="25%,75%" frameborder="no">
<frame src="menucolor.htm" name="menu">
<frame src="chapter1.htm" name="content"
   marginheight="30" marginwidth="50">
</frameset>>

</frameset>

</html>



Here's what it looks like.


Setting User Controls


There are two user controls that you can turn on and off by using certain attributes in your <frame> tags. These are detailed in the following:
  • noresize ~ The default setting in HTML frames permits the user to resize any frame by hovering the mouse pointer over the frame border and then clicking-and-dragging. Inserting the noresize attribute in any <frame> tag will disable resizing in that frame.
  • scrolling="yes|no|auto|" ~ Frames automatically display horizontal or vertical scrollbars whenever the frame's content outsizes the allotted dimensions of that particular frame. If the frame's content fits within the allotted dimensions, however, then no scrollbars are displayed. This is the default setting for frames and is the same as using the scrolling="auto" attribute/value pair. If you wish to always display scrollbars in a particular frame then use scrolling="yes". If you wish to always hide scrollbars in a particular frame then use scrolling="no".

*   *   *


By now you have enough information to create a full-blown framed website but before you launch it, you should be well aware of some of the common problems when using frames...





Best Free Stuff
for webmasters

Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates

See also:

Best Free Web Hosting

 

If you need a .COM web address, you can get one quick and easy at...

www.GoDaddy.com
<~ BACK TOP NEXT ~>
 
HTML Tutorials |  CSS Tutorials |  Web Hosting |  Domain Names |  Web Design Resources
Iron Spider © Copyright 2004-2011 Robert Darrell