Alright, so I've got some of my website made. In one file, I have my menu (which will be on the left). In another file, I have my header (with the site logo and title and stuff). In another file, I have my footer (contact info, date modified, etc.).
I've tried using Google to find something, but it is so confusing and no one seems to explain it right.
When I make my index file, how to I insert the header, footer, and menu? As simply as possible! I want to make a template so that I can just insert the new article in each time.
Any help here?
Thanks in advance.
Five answers:
2010-02-23 20:09:28 UTC
must use divs an combine with css to create layout of webpage, getting it right can be extremely frustrating (speaking from experience) check out w3schools site here:
http://www.w3schools.com/css/default.asp
Since css controls pretty much every aspect of presentation u must learn, JQuery framework (based on javascript) is also handy to get a basic knowledge of to create standard animated fx how ever would still focus on css first.
tankson
2016-10-22 02:01:41 UTC
If the cyber information superhighway information superhighway website isn't yours you ought to't fix the coding. If all of us had get get right of entry to to to all of us else's code like this there would not be working information superhighway website left on the entire cyber information superhighway in a pair of hours.
?
2010-02-28 08:07:27 UTC
I assume you want your page to look something like this:
|-------------------------
| Header
|-------------------------
| M | Content
| e |
| n |
| u |
|-------------------------
| Footer
|-------------------------
If this is what you want, then I would suggest using a stylesheet and template like the following:
styles.css
- - - - - - - - - - - - 8< - - - - - - - - -
/* styles.css */
/* background colours used for demonstration purposes */
div#page {
width:900px;
margin:0 auto;
}
div#header {
width: 100%;
background-color: red;
}
div#menu {
width: 200px;
float: left;
background-color: green;
}
div#content {
width: 700px;
float: left;
background-color: blue;
}
div#footer {
clear: left;
background-color: yellow;
}
- - - - - - - - - - - - 8< - - - - - - - - -
template.html
- - - - - - - - - - - - 8< - - - - - - - - -
"http://www.w3.org/TR/html4/loose.dtd" >
Template
Insert Header here
Insert Menu here
Template
This is a template with menu, header and footer
Replace the heading (h1) and these two paragraphs (p) with your page content.
- - - - - - - - - - - - 8< - - - - - - - - -
To use this template just make a copy of template.html and put in your content. However if you ever want to change the template later, you will have to change each page you have generated from it.
To avoid this problem you could use server side includes, or my favourite, the html pre-processor PPWizard.
For more on PPWizard see: http://www.html-tags-guide.com/html-software.html
For more on the link tag for linking the stylesheet see: http://www.html-tags-guide.com/html-link-tag.html
jimbot
2010-02-23 20:00:08 UTC
If you are using plain HTML you can't really do that, except for (ugh) frames or (ugh ugh) javascript.
If you are using php or asp or something it's very easy, and you should look up "php include" or "asp include".
?
2010-02-23 23:17:12 UTC
HTML:
PHP
include_once("path/here");
ASP
Javascript
Take your pick.
for reference:
http://webdesign.about.com/od/ssi/a/aa052002a.htm
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.