<frames>
| |
|
I don't think anybody wholeheartedly loves frames. For me, sometimes
they're a necessary evil. <contents> <about> ![]() | |
Pros:
|
Cons:
|
So the main problem with frames is having to deal with frames pages made by people who don't really know what they're doing. The other problem with frames is getting nervous about whether your frames page looks good on other people's computers. When would you want to use frames? It's hard to say. I've used frames before to create a navigation sidebar that stays static. For instance, on my Kickstand page, I have 39 links associated with the main zine page. It would be terrible to have to create a way to navigate those 39 things without frames. With my frame sidebar, I only have to make it once and everything stays in a nice green border. It's easy to get anywhere at any time using it. <the left-hand sidebar frame> ![]() | |
|
<html> <head> <title>Left-hand sidebar</title> </head> <frameset cols="175,*" border=no frameborder=0 framespacing=0> <frame name="sidebar" src="sidebar.html" marginwidth=0 marginheight=0 scrolling=auto> <frame name="main" src="main.html" marginwidth=0 marginheight=0 scrolling=auto> <noframes><body> <p>This page uses frames, but your browser doesn't like them. Click <a href="frames.html" target="_top">here</a> to go back.</p> </body></noframes> </frameset> </html> | |
| See what it looks like. | |
<the <frameset> tag> ![]() <frameset> is where you specify all the info about the entire frames page. It looks like this:
<frameset cols="175,*" border=no frameborder=0
framespacing=0> cols - this lets you say how many columns you want, and what size. If you want two columns, one 175 ../pixels wide, and the rest left to fill up the screen, you do it like it's done above. If you want a left column, a center, and a right column, you'd do something like this: <frameset cols="100,*,100"> That would give you two outer frames, 100 ../pixels each, and one middle frame. rows - if for some reason you want a top frame, bottom frame, or both, you'd use "rows" instead of "cols." For example: <frameset rows="50,*"> would give you a top frame 50 ../pixels high and then your page under it. border - this is whether you want a border between all your frames or not. Trust me, you don't. I can't think of one good reason to do this. Border is either "yes" or "no." frameborder - specifies if you want a border or not. "yes" or "no" - I'm actually not too sure what the difference is between "border" and "frameborder." framespacing - This is whether you want space in between your frames or not. Again, I can't think of a reason why you would want space. <the <frame> tag> ![]() This where you pick your preferences for each frame. If you have three frames, you've gotta have three <frame> tags. <frame name="content" src="page.html" scrolling=no noresize marginwidth=0 marginheight=0> name - each frame has to have a name so you can refer to it later when you're creating links. src - this is the path to the HTML document you've created to be the content of the frame. scrolling - this sets whether your frame has scrollbars on it or not. You have three choices: yes, no, or auto. If you say "yes," your frame will have scrollbars on it regardless of whether they're necessary or not. If you say "no," you will never have scrollbars, even if the person viewing your page can't see the whole frame, because it's being cut off. "Auto" is by far the best choice. If your viewer can see all of the contents of the frame, they won't have a scrollbar. If their screen is tiny and they can't see it a scrollbar will appear. So plan to make your page so people won't have to scroll, but make it possible for them to in case you screwed up or their computer is pitiful. noresize - include this tag if you don't want viewers to be able to resize your frame. Use this with caution! If your frame has only pictures in it, you're probably safe. If your frame has text in it, watch out, because a lot of people view webpages with a ridiculously huge text size and if you say "noresize" in your frameset, they won't be able to resize it, and your words will just be cut off and impossible to see for them. Also keep in mind that people have wildly varying screen sizes. If you have a large screen size, you may want to look at your page in a browser window that could fit in your palm, just to see if it gets screwy-looking. marginwidth - kinda cool - you can indent your frames if you want. Specify marginwidth in ../pixels. marginheight - Same as marginwidth. If you want one of your frames to have top and bottom margins, set these in ../pixels. <creating links> ![]() This is one of the most important things about making a page with frames: get your links to work right! There are three ways to link from frames pages. 1) Link from your sidebar to your content, keeping it all within your frames.
2) Link to other pages, making them come up in the same browser window as your page was in, but not in your frames.
3) Link to other pages, making them pop up in a new window.
Option #3 actually really sucks and should only be used when the visitor needs to be staying on your page, but quickly viewing some external info and then closing the window again. Keeping people inside your frames on purpose is another topic, and so hideous we won't even discuss it. Just don't do it. Not even on accident. A friendly thing to do on your pages if your frames could be in any way irritating is to provide a link for people to jump out of your frames with. For example, if your frameset page is page.html and the two frames in it are sidebar.html and main.html, you may want to put a link on your page somewhere to jump out of the frames and just look at main.html. <a href="main.html" target="_top"> no frames</a> is how you would do that. What you have to do if you do that is provide a way for people to navigate your site without frames. What I mean is that main.html would have to have links on it. This is also helpful if someone links to a frame on your site - that way people will be able to click their way back. Just putting a link to your main page on each content (i.e. not a sidebar) page in a frame can help that. | |