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
 
 
 

 

Frame Border Width

 
It's unfortunate that those who take the time to learn about the presentational aspects of web page frames are few and far between and it's even more unfortunate that the default appearance of web page frames is essentially butt-ugly (probably because it's so overused).

However it doesn't have to be so.

There's a number of attributes you can apply to your <frameset> and <frame> tags to modify and (hopefully) improve their appearance and usability.

We'll start with learning how to set the width of your frame borders. (All the examples below will be a modification of the advanced frame layout discussed in more detail on a previous page.)

How to Set the Width of All Frame Borders


To set the width of the all borders in your frame layout, use both the framespacing attribute and the border attribute in the primary <frameset> tag of your frameset document. The value used in each attribute represents the width in pixels. (Note that the frameborder attribute must be either absent or have its value set to "yes".)

Here's the source code of our advanced frame layout tweaked to display borders that are 20 pixels in width:


<html>

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

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

<frame src="header.htm">

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

</frameset>

</html>



Here's what it looks like with the width of all borders set to 20 pixels.
Here's what it looks like with normal borders.


How to Set the Width of Some Frame Borders


To set the width of just some but not all frame borders, insert the framespacing and the border attributes in a nested <frameset> start tag.

Here's the source code of our advanced frame layout tweaked to display borders that are 20 pixels in width only between the columns in the bottom frame row:


<html>

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

<frameset rows="20%,80%">

<frame src="header.htm">

<frameset cols="25%,75%" framespacing="20" border="20">
<frame src="menu_adv.htm" name="menu">
<frame src="chapter1.htm" name="content">
</frameset>

</frameset>

</html>



Here's what it looks like.


Conversely, you could use the framespacing and border attributes in your primary frameset and then use the frameborder="no" attribute/value pair in the nested frameset.

Here's the code:


<html>

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

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

<frame src="header.htm">

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

</frameset>

</html>



And here's what it looks like.


(NOTE: Internet Explorer and Opera support both the framespacing and border attributes while Gecko-based browsers only support the border attribute. It's best to cover all the bases and use both framespacing and border when setting frame border widths.)


How to Remove All Frame Borders


To completely remove all borders in your frame layout, use the frameborder attribute in the primary <frameset> tag of your frameset document and set the value to "no" (default is "yes").

Here's the source code of our advanced frame layout tweaked to display no borders:


<html>

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

<frameset rows="20%,80%" frameborder="no">

<frame src="header.htm">

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

</frameset>

</html>



Here's what it looks like with no borders.
Here's what it looks like with borders.


How to Remove Some Frame Borders


To remove only some frame borders (but not others) in your frame layout, use the frameborder attribute in the <frame> tags of your frameset document and set the value to "no" (default is "yes"). This will remove the borders only from the frames you apply the setting to.

Here's the source code of our advanced frame layout tweaked to display no borders between the columns in the bottom frame row:


<html>

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

<frameset rows="20%,80%">

<frame src="header.htm">

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

</frameset>

</html>



Here's what it looks like with no borders between the columns.
Here's what it looks like with borders.



*   *   *


Next, let's apply some color and learn how to tweak the user controls...





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