Path // www.yourhtmlsource.comFrames → ADVANCED FRAMES

Advanced Frames


Once you've gotten the hang of frames, all that's left to learn is a big list of attributes, most of which help you control your layout with things like spacing and margins and whatnot. You can even add a bit of colour.

Clock This page was last updated on 2012-08-21



Layout-related attributes

All of these attributes go into the main <frameset> tag, and affect all frames contained in it.

border="x"
sets the width of the grey borders between frames, in pixels, for Netscape browsers.
frameborder="x"
is the same as the attribute above but for Internet Explorer. If you use one, use them both.
framespacing="x"
denotes the distance between frames, in pixels.

These attributes go in single <frame> tags, and as such, only affect that particular frame.

frameborder="x"
sets the border thickness around that frame. (IE)
framespacing="x"
sets the amount of blank space around this frame.
marginheight="x"
sets the margin (or, if you like, padding) from the top and bottom of the frame for the content of the frame.
marginwidth="x"
sets the margin from the sides. Note that these last two are added on to any margins you have specified in the framed page's <body> section.
noresize
stops the user from being able to widen or contract the frame as they want, so your layout doesn't get messed up. It doesn't need any value.
scrolling="..."
allows or prohibits the frame from scrolling if the contents will not all fit into the viewable area. Attributes are "yes" or "no". If you don't let it scroll, people with small screens/low resolutions may not be able to see all your page. Test it.

sourcetip: for completely seamless frames, put all three of these attributes into your frameset tag:
frameborder="0" framespacing="0" border="0"

Using Sections

You can have a frame page open at a specific part of the page if you want. It is a system borrowed from the one used for internal links.
First, in the frame page, split it into sections, with

<a name="section"></a>

at each key point. Then in your frameset page, in the source of the frame, add #section onto the end of the filename. So it would be

<frame src="content.html#section">

With this you can have a frameset displaying different parts of the same page simultaneously.

Border Colours

This is very easy. Add the attribute bordercolor="..." to the main frameset command. You can set the color differently for each frameset you have in your layout, or specify it for individual frames by putting it into the frame tag. Remember, the thickness of the border will depend on the width you set them as using the attributes above. Set the colours in HEX format or as a named colour.