webpage inside webpage (don't know what to call it...)

lhamil64

In Runtime
Messages
398
i have seen many websites where there is like a mini-website for navigation inside a website so that you click a link and the navigation is still there. i don't really know how to describe it but here is a screenshot of what i mean:


sorry that its a link i didn't have time to go to photobucket and upload it. also i kinda wanted to try out imageshack :D :D
 
you really shouldn't use frames anymore. The W3 is going to, or has already dropped their reccomendation for the frameset dtd because it isn't supported well accross multiple browser platforms. The best way to do this, which the W3 still isn't a fan of, is to use an iframe(inline frame).
This is also less complex.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]">
<html xml:lang="en-us" dir="ltr" lang="en-us" xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>This is the title</title>
 </head>
 <body>
  <div id="mainDiv">
   <div id="navigation">
    <table id="navTable">
     <thead>
      <tr>
        <th colspan="1" valign="bottom" align="center" style="text-align: center;">
         Navigation
        </th>
      </tr>
     </thead>
     <tbody>
      <tr>
        <td colspan="1" valgin="top" align="left">
         <a href="#" target="mainFrame">Link 1</a>
        </td>
      </tr>
      <tr>
        <td colspan="1" valign="top" align="left">
         <a href="http://www.google.com" target="mainFrame">Google</a>
        </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div id="contentDiv">
    <iframe id="mainFrame" name="mainFrame" src="http://www.altavista.com"  frameborder="0" scrolling="auto"></iframe>
   </div>
  </div>
 </body>
</html>

the name of the iframe is the important part. The name is the part that you put in the target attribute of your links. Thats just a basic example of how to use iframe's. You can also set their background to be transparent. You can set it up in such a way that your user doesn't even know it is a separate frame. Hope that helps.
EDIT: also, none of the xhtml dtd's support the name attribute in the ifram tag, let alone the iframe tag itself, you're probably going to have to use the loose dtd for html 4.0
 
Yeah, like Daeva says, I wouldnt recommend using frames any more.. They are extremely annoying and are unreliable at the best of times..
 
Thanks!
is there some HTML code i can use that will see what the users browser is and check to see if it supports them, then if it doesn't pop up a message box or redirect to another page that will tell them that the page has content that can not be displayed?
 
not html, but javascript yes.
First, you'll want to have the different browsers installed on your computer to test which elements work and display in what way. Next, you'll need to add javascript to the page that you want to check. Once you know which browsers and versions are compatible with which elements of the html, you know what to check for. These can be looked up in a google search like "browser compatibility chart" or some search like that.
Here is an example of the code, and this site also provides information about the code examples.
http://www.javascriptkit.com/javatutors/navigator.shtml
Hope this helps, good luck.
 
Back
Top Bottom