| Frames - basics |
|
< basics > targeting nesting esthetics noframes bad things quick recap tags epilogue |
I'm not too fond of frames myself. The layout of normal website pages is far better and easier done with tables. But there are situations where their use is acceptable or even unavoidable. Like for instance when you want to show a set of external links and the linked pages at the same time. Switching back and forth would be the only other option. Which may be quite cumbersome. Frames are a construct to show several web pages in one browser window. You create a page with sub windows, in which you show other pages. Those other pages may contain yet other framed pages. The first page is in fact not a normal web page, but a "frameset" containing one or more framed web pages. To understand frames, it is very important that you grasp this concept.
There is no body
<HTML> What you see here is in fact the simplest frame page possible. One frame page, containing only one frame, showing only one webpage, page.html. You see the body is replaced by a frame set. Starting and ending with the FRAMESET tag. Inside it there is the reference to the page to be framed with the FRAME tag. the attribute SRC, or source, specifies the page to be framed. This can be any qualified URL you desire. Any page that can be viewed in a web browser, can be viewed through a frame. One frame doesn't make much sense, so let's add one. Some browsers don't even accept a frameset with only one frame. <FRAMESET COLS="50%,*">
Rows and columns <FRAMESET COLS="50%,*" ROWS="50%,*"> Instead of columns you can also create ROWS. In fact you can use them together. The code above will create a frameset with four frames, two above and two below. You can make as many frames as you like, but try to not to make it too complicated. Two or three frames is more than enough for your browser to handle. Frames are always displayed slower than a normal web page. The sub pages are only loaded after the frameset page is complete.
<FRAMESET COLS="*,50%,*"> Some other possibilities, try to imagine what they do, or just make them. Sets three and four will do exactly the same.
Don't just sit there, DO something! |