HTML frame code tutorial – Frames part 3

HTML frame code tutorial – Frames part 3 cover image
  1. Home
  2. HTML
  3. HTML frame code tutorial – Frames part 3

Important attributes of <FRAMESET>

Let’s make another file which tests these attributes.

<HTML>
<HEAD><TITLE>My second framed page</TITLE>
</HEAD>
<FRAMESET ROWS="20%, 80%" FRAMEBORDER="NO" BORDER="3">

   <FRAME SRC="menu.html">
   <FRAME SRC="main.html">

</FRAMESET>
<NOFRAMES>
There is no frame support on your browser.
</NOFRAMES>
</HTML>

We’ll name this file frames2.html. You can have a look at it by clicking here.

So what did you make out?
The two frames have now been displayed horizontally, courtesy the ROWS attribute. BORDER is set to ‘3’ which makes a three pixel thick border. (The border is displayed even though FRAMEBORDER is set to ‘NO’. This is because the BORDER attribute is specified).
To make the border disappear, set the values for BORDER and FRAMEBORDER to 0 and NO, respectively.

What is the wildcard “techie” term I introduced before?

If you have ever worked in a DOS window or a Unix prompt, you know what a wildcard is. For people who don’t, here is the explanation.
A wildcard character matches any character or sequence of characters. So if you type DIR *.html at DOS prompt, you shall get a listing of all html files in that directory. A wildcard is not used in that sense in COLS and ROWS. Here it signifies “ rest of “.
So,
COLS=”200, *”
will tell the browser to allocate 200 pixels vertically for the first frame and the rest for the second frame.

Similarly,
ROWS=”10%, *”
will place the first frame in 10% of horizontal space and the rest will be occupied by the second frame.

You would also have noticed that wildcards can be used with both pixel and percentage values.

HTML