eHow launches Android app: Get the best of eHow on the go.

How To

How to Open a Link on the Same Window When Using Frames

Contributor
By Kristen Leigh Grubb
eHow Contributing Writer
(0 Ratings)

Using frames allows your web pages to be broken into sections that can be manipulated independently. For instance, you can have a banner on the top of your page that remains static while the visitor moves from page to page within your site. For this to happen, the links in the main frame of the page must open in that frame, rather than in a separate window or in the top frame. The HTML attribute "target" is used to specify where you want the link to open.

Difficulty: Easy
Instructions

Things You'll Need:

  • Text editor
  • Web browser
  1. Step 1

    Open any text editor, such as Windows Notepad.

  2. Step 2

    Create the frameset document. This is the document that contains all of the frames for the web page. The frameset document will reference external web pages for each frame. The format of the document will look like:
    <html>
    <head>
    <title>Title of Web Page</title>
    </head>
    <frameset rows="20%,*">
    <frame name="top" src="top.html">
    <frame name="main" src="main.html">
    </frameset>
    </html>

    In this example, the top frame will display the web page "top.html" and the main frame will display the web page "main.html." The page "main.html" contains links that will open in the same frame while the "top.html" page contains information that does not change, such as the site banner.

  3. Step 3

    Save this document with a title such as "index.html."

  4. Step 4

    Open the "main.html" document in a text editor.

  5. Step 5

    Create the "main.html" document as you would any web page.

  6. Step 6

    Use the syntax "<a target="_self" href="http://example.com">example</a>" for any links in the document. The "target" reference is what opens the link in the current frame.

  7. Step 7

    Test the link by opening the file "index.html" in any browser and clicking on the links.

Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

eHow Computers
eHow_eHow Technology and Electronics