Enterprise Software

Fun with frames: Beautify your frames

Beautify your frames by giving them a seamless appearance.

By Paul Anderson
(updated 5/20/99)

Framesets started out functional but homely. The browser vendors have since added attributes to help Web builders make their frameset pages both aesthetically pleasing and more adaptable in terms of layout.

By default, framesets have a raised border between frames, but you can remove this border to give your frameset a seamless appearance. In HTML 4.0, you eliminate this border using the frameborder=0 attribute in the <FRAME> tag. The 3.0 and later releases of Navigator and Internet Explorer also support this attribute in the <FRAMESET> tag, which removes the borders from all frames except those with the attribute frameborder=1.

Depending on a given browser's preferences, the frameborder attribute can still leave a color border between the frames. Truly seamless frames require that you add proprietary attributes to the <FRAMESET> tag: framespacing=0 for Internet Explorer, and border=0 for Navigator and Opera.

<HTML>
<HEAD><TITLE>FrommCo home page</TITLE></HEAD>
<FRAMESET cols="115,*" framespacing=0 border=0>
 <FRAME src="menu.html" frameborder=0
  noresize scrolling=no>
 <FRAME name="content" src="main.html"
  frameborder=0>
</FRAMESET>
</HTML>

Users can normally resize frames using the mouse cursor, but the noresize attribute locks the frame at your specificied dimensions. The scrolling=no attribute supresses scroll bars on the frame, and a yes value ensures them, while the default value auto adds them only when the frame's content extends beyond the frame's boundaries.

Two more <FRAME> attributes, marginheight and marginwidth, take pixel values for the top and left margins between the frame border and content. A zero value sets the content flush with the frame edge. Without these attributes, the margins default to those of a normal browser window.

Paul Anderson is senior producer and technical editor for CNET Builder.com.

Editor's Picks