How to Make a Website Framed or Not Framed

104 7
    • 1). Open a word processing program and save the blank file as "frame.html" before writing any code.

    • 2). Copy and paste the following code into the file:

      <HTML>

      <FRAMESET COLS="50%, 50%">

      <FRAME SRC="page1.html">

      <FRAME SRC="page2.html">

      </FRAMESET>

      </HTML>

      Save the file and open it in an Internet browser. The page is divided down the middle by a frame. The right and left sides are blank because you have not created Page1 or Page2.

    • 3). Play with the FRAMESET COLS values to move the frame in the screen. "50%, 50%" makes both of the frames equal size, so the divider is in the center. A value such as "25%, 75%" will make the left frame 25% of the screen, and the right frame 75% of the screen.

      Try a few different combinations to see for yourself. Each time you change the values, save the file and refresh your browser to see the changes.

    • 4). Add horizontal columns with the code

      <HTML>

      <FRAMESET ROWS="75%, 25%">

      <FRAME SRC="page1.html">

      <FRAME SRC="page2.html">

      </FRAMESET>

      </HTML>

      As you can see the code is the same, but instead of using COLS (columns), we're creating ROWS. The "75%" controls the top section; the "25%" controls the bottom. Just as in step three, these numbers can be adjusted to any setting that you want.

    • 5). Name the frames by adding the following text to the FRAME line of code:

      <FRAME NAME="1" SRC="page1.html">

      The name can be anything that you want. For example, if you plan to have a menu on the left and a main page on the right, the HTML might look like this:

      <HTML>

      <FRAMESET COLS="30%, 70%">

      <FRAME NAME="menu" SRC="page1.html">

      <FRAME NAME="main" SRC="page2.html">

      </FRAMESET>

      </HTML>

      Naming the frames becomes important when you want to link between them.

    • 6). Create two new HTML documents titled "page1.html" and "page2.html" -- respectively. Fill them with whatever you want and save them. Once this is done, reload "frame.html" in the Internet browser. The two blank frames have been replaced with the content of "page1" and "page2."

    • 7). Link one frame to another by adding the following link in "page1":

      <A HREF="http://www.example.com" TARGET="main">CLICK HERE!</A>

      The TARGET="main" part of the code tells the browser that when the link is clicked it should be displayed in the frame titled "main." A regular link will simply affect the frame that it is in.

    • 8). Create a link to leave the frames page with the code

      <A HREF="http://www.example.com" TARGET="_top">CLICK HERE!</A>

      The code -- TARGET="_top" -- overrides any frames and loads the link in the full browser window.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.