Using FramesHow to add HTML frames to your web siteWhen working with frames, it's important to know that a page with frames is really a page split into 2 or more sections, each containing its own html document. Here is an example of how a page with 2 frames might look:
It looks like you just split up and defined a section of one page, but both frames are actually html pages. The page that houses the two frames is also its own html document. So let's begin by looking at how the main page can create frames. This is done by using the <FRAMESET> tag rather than the body tag at the beginning of the document. Here is an example of html code that will produce 2 frames, splitting the page down the middle: <HTML> So, what does all of this stuff do? Here's the list:
The browser will read your frame src tags for the columns from left to right, so be sure to keep everything in the order you want it to appear. Now, maybe you'd like 3 frames accross the page, uinstead of 2? You just need to do modify your frameset tag and add another frame src tag for the third frame, like this: <FRAMESET
cols="33%,33%,33%"> Now you will have 3 columns on the page, each column would be 33% of the total width of the page. If you don't want to leave it up to the browser what to do with the other 1%, you can change one value to 34% or decide to define the value in pixels instead. So what about adding frames that go from top to bottom? Maybe you want something that looks similar to this:
Well, now what we do is add another FRAMESET tag, but this time we use the "rows" command. Here the code to get a page divided like the example above: <FRAMESET
cols="50%,50%"> The rows command reads from top to bottom, like the cols command reads from left to right. You can have as many columns or rows as you like, but be sure to nest your frameset tags the way you want the frames to appear. In the example above: Got it so far? Piece of cake, right? LOL The next section, will show you some other great stuff we can do with frames. Frames 2: Linking and stuff. |
||||||
|
webmaster
Middleburg, FL 32068 |
|||