|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Using Muliple HTML documents
I'm sure that since this was something that could be done using frames that I would be able to do this in CSS, and all I have to do is search around the internet for hours, or buy a book to find the answer, but I don't have the time to do that on the net, and there are not a lot of good book stores in Iraq.
I have created a Web Page that has the header section and a menu section, along with the body and a footer using CSS, and DIV and all of that. It looks nice, but in order to have menu on all of my web pages I have to have it in every HTML doc. Using Tables I could just reference one html document that had the menu in is, and it would be put in that frame. At least that is how I recall that it worked, it has been many years since I did this. Any help on this, or are you forced to code this into every HTML document? |
|
#2
|
||||
|
||||
|
You may be looking for Server Side Includes.
|
|
#3
|
||||
|
||||
|
includes
Hi engineerairborn, welcome to the forums,
How you go about this depends on what capabilities your server has. For example, with PHP I can do something like header.php Code:
<head> // stuff here </head> menu.php Code:
<div> //menu here </div> footer.php Code:
// stuff here Then on each page I can do Code:
<html> <?php include header.php; ?> <body> <?php include menu.php ?> // page content here <?php include footer.php; ?> </body></html> |
|
#4
|
|||
|
|||
|
Right now I do not have any server capability. Basically I'm just starting to create pages for a website that I want to get up and running for when I get home. So the pages are all static.
I may have misspoke in my first post. Maybe it was frames that I was thinking off. Where you could set a frame and use the src property to call in another HTML page into the frame. For some reason I thought that this could also be down in tables. Any way, Using the frames of old as a reference can this same thing be done with CSS and DIV So I would have for example my page that would have the header, and the menu and the footer, but the middle the content portion would be the only part that changes loading in a new page. With out having to put a frame there. |
|
#5
|
||||
|
||||
|
frameset
A frameset page is kind of like using a table for page layout I guess. I figured that's probably what you meant.
If you don't have a server then I guess you're somewhat limited as to how deep into specifics you go. Although I wouldn't recommend frames as they're "falling out of favor", they are still widely supported. And if usability, SEO, and/or cross-browser support, ever became an issue for you, you could probably "migrate" to includes at some point with minimal rewriting. This is an example page Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>Frameset Page</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<FRAMESET ROWS="*,100">
<FRAMESET COLS="40%,*">
<FRAME NAME="Menu" SRC="nav.html" TITLE="Menu">
<FRAME NAME="Content" SRC="main.html" TITLE="Content">
</FRAMESET>
<FRAME NAME="Ad" SRC="ad.html" TITLE="Advertisement">
<NOFRAMES>
<BODY>
<H1>Table of Contents</H1>
<UL>
<LI>
<A HREF="reference/html40/">HTML 4 Reference</A>
</LI>
<LI>
<A HREF="reference/wilbur/">HTML 3.2 Reference</A>
</LI>
<LI>
<A HREF="reference/css/">CSS Guide</A>
</LI>
</UL>
<P>
<IMG SRC="ad.gif" ALT="Ad: Does your bank charge too much?">
</P>
</BODY>
</NOFRAMES>
</FRAMESET>
</HTML>
Because the navigation links open in frames, you will need to "target" what frame they open in. http://www.w3schools.com/html/html_frames.asp This can be done with CSS and divs, but unless you wanted to use iframes in the divs, you need some kind of way to include (PHP, Perl, Asp, Jsp, etc.) and without a server that should probably wait for now. Last edited by Mittineague : June 14th, 2007 at 08:53 PM. |
|
#6
|
|||
|
|||
|
I hear yah.. That is sort of what I thought. Not a big deal, I will just start working on the back end, and wait till I get home then to work on the front end rather then Manually writing, and re-writting each page as I add a new menu item or such.
I think maybe I will just write a small VB/Access app that will create the pages for me with the information I place in a database. Thanks for the input guys appreciate it. I have a lot of chatching up to do since I have been out of the programming field for 2 years. So what is hot these days besides Java and CSS? |
|
#7
|
|||
|
|||
|
I'd avoid framesets as they can upset you SEO.
You should use server side includes but you can do that easily with just th .shtml extension. most hosts will run this although it may need to be activated. The rest is like html but it with embeds other sections with the include tag. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Advanced Web Development > Using Muliple HTML documents |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|