Frames 2: Linking and AttributesHow to link between frames, change frame attributes, and use the noframes tagSo, now you have a page with frames. But when you place a link inside a frame, the url you linked to will only appear in that same frame! Doh! Well, this is because a link within a frame will default to showing the next page inside the frame the link is in. Wouldn't you like to have the link put the new page in another frame, or come up without any frames around it? The trick is to name each frame, and then specify the target frame in your link. Here is how to do it. First, add the name="yourname" attribute to each frame, like this: <FRAMESET cols="20%,80%"> Now that each frame has a name, you can use either frames name as a target inside a link tag. So, let's say you had a link inside the left_frame (page1.htm). If you want the new page to show up in the right_frame, you need to add the target="frame_name" command to your link tag. The following example link tag will be in the left_frame, but make the output show up in the right_frame: <A HREF="aboutme.htm" target="right_frame">About Me</A> Now the left_frame will remain unchanged, while the linked url will show up in the right frame! If you want to see the example at work, click here. You can link to any frame you want to this way, just remember to name all of your frames so you can target them. Now, one of the most common problems is this: How do I link to another page, but not have it show up in my frames?? Well, here's how..To make another page show up like it normally would, you need to set the target command in your link tag like this: <A HREF="http://www.someplace.com" target="_top">See my friend's Homepage!</A> target="_top" Now, here are some attributes you can add to your individual <FRAME> tags to help you control the design of the frames:
Had enough yet? Well, there is one more thing you will want to know. How do I display something for people who don't have a browser that supports frames? Well, right before you close your last FRAMESET tag, add this tag to your page: <NOFRAMES> Now users without newer browsers can see something, and decide whether or not to go to your alternate page (which they will, because you told them to go there!!). Well, that about does it for now....so let's go on to the next section, Invisible Frames. |
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |