HTML Question

Discussion in 'HTML & Website Design' started by Nimrod EX, Oct 21, 2008.

  1. #1
    Well I've taken the advice of some helpful users here, and I'm now using W3schools and learning HTML.
    But i've reached a section (frames section), and I just don't understand how it works.

    http://www.w3schools.com/html/html_frames.asp (<--- thats the section).

    They are talking about "Frames" (displaying more than one webpage in the same browser window) but there are a few things I don't get:

    <html>
    
    <frameset cols="25%,50%,25%">
    
      <frame src="frame_a.htm">
      <frame src="frame_b.htm">
      <frame src="frame_c.htm">
    
    </frameset>
    
    </html>
    
    HTML:
    Here are my questions:

    1.
    The code is <html> <FRAMESET> (not body)...so am I supposed to make a completly different page than the one i've been working on up until now (<body> tag) and just insert it into (for example) "Frame_a"?

    2.
    Frame_a and frame_b and frame_c.
    Lets say I have a file named frame_a, will the computer find the file on its own? or does it have to be in the same folder as the rest of the HTML files? (some sort of root folder maybe? I dunno...).
    And is there some other thing I have to do to get that page to appear there?

    3. Lets say the page I want to put as Frame_a is a very big page, but I've only set the "frameset cols" to 25% of the screen. How will my page appear? will it shrink or something and fit? or will just a part of it show?


    Thanks in advance and sorry for all of my pampering questions! :)
     
    Nimrod EX, Oct 21, 2008 IP
  2. almondj

    almondj Peon

    Messages:
    768
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #2
    1. Each frame should be a full html page with body tags and such.

    2. frame a, b, and c will have to be in the same directory as the main file that's calling them.

    3. The percentages represent how much each frame will use on the screen, if it's at 25% the frame will take up 25% of the users screen.

    Full page code:

    <html>
    <body>
    
    <frameset cols="25%,50%,25%">
    
      <frame src="frame_a.htm">
      <frame src="frame_b.htm">
      <frame src="frame_c.htm">
    
    </frameset>
    
    </body>
    </html>
    HTML:
    Frame a:
    
    <html>
    <body>
    Frame A text and content
    </body>
    </html>
    
    HTML:
    Frame B and C would be the same as the above frame A.
     
    almondj, Oct 21, 2008 IP
  3. Amisha_Sharma

    Amisha_Sharma Banned

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi

    When you use frames in frameset,then different frames will display different pages you want to display at a time on the screen.

    you have to give the path of the files where you have stored them.

    The percentages represent how much space of the screen each frame will take and if the size of the frame is larger thanthe assiened % then scrolling bars are added,so that you can view the whole page.
     
    Amisha_Sharma, Oct 22, 2008 IP
  4. Nimrod EX

    Nimrod EX Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you all very much! (Yet again).
    Just one final question:
    
    <html>
    <body>
    
    <frameset cols="25%,50%,25%">
    
      <frame src="frame_a.htm">
      <frame src="frame_b.htm">
      <frame src="frame_c.htm">
    
    </frameset>
    
    </body>
    </html>
    
    HTML:
    That doesn't have to be the WHOLE content of the page right? It can also be: (for example)

    
    <html>
    <body>
    
    <text and lots of HTML stuff>
    <frameset cols="25%,50%,25%">
    
      <frame src="frame_a.htm">
      <frame src="frame_b.htm">
      <frame src="frame_c.htm">
    
    </frameset>
    <some more HTML stuff>
    
    </body>
    </html>
    
    HTML:
    And if so, how do I position the frames and decide if I want it to be in the middle of the page or on the sides?

    Or should a page containing frames be a new page altogether with ONLY that code?
     
    Nimrod EX, Oct 22, 2008 IP
  5. Artimmi

    Artimmi Active Member

    Messages:
    130
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    68
    #5
    Hi Nimrod EX,

    Almondj answered on everything correctly.

    These are answers on your last ones: Yes, you can use frames to be just a part of your page content, as addition to the main texts, images etc.

    You can set positions for your frameset by including it into the other tags, for example:

    
    <html>
    <body>
    
    <div style="align: right;, with: 200px;">
    <frameset cols="25%,50%,25%">
    
      <frame src="frame_a.htm">
      <frame src="frame_b.htm">
      <frame src="frame_c.htm">
    
    </frameset>
    </div>
    
    </body>
    </html>
    
    Code (markup):
    or

    
    <html>
    <body>
    
    <table>
    <tr>
    <td>[some content here]</td>
    </tr>
    <tr>
    <td>
    <frameset cols="25%,50%,25%">
    
      <frame src="frame_a.htm">
      <frame src="frame_b.htm">
      <frame src="frame_c.htm">
    
    </frameset>
    </td>
    </tr>
    <tr>
    <td>[another content here]</td>
    </tr>
    </table>
    
    </body>
    </html>
    
    Code (markup):
    there are also frame tags like this

    
    <iframe src="folder/file.html" />
    
    Code (markup):
    where "folder/file.html" is included file location relative to the main file with this code.
    for example: "../" in "../folder/file.html" means that included file is one level up relative to the main file location (if index.html is in "/home/user" directory, file.html is in "/home/folder directory", NOT in "/home/user/folder" directory).

    BTW frames aren't common in usual design nowadays, they are usually used for banner and other advertisement systems.

    Try to learn about tables, divs, fonts, links and images first.

    -Artimmi
     
    Artimmi, Oct 22, 2008 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    I suggest you read HTML4 §16. Frames in HTML Documents. Note §16.2, where it says "Elements that might normally be placed in the BODY element must not appear before the first FRAMESET element or the FRAMESET will be ignored."

    The truth is, frames are evil, and should not be used without compelling reason. Whatever reason you think might be compelling, believe me, it's not. Just skip over that section of the tutorial. W3Schools is pretty much out of date anyway. Go over to htmldog.com instead.

    cheers,

    gary
     
    kk5st, Oct 22, 2008 IP