tags:

views:

410

answers:

5

How do I create a webpage with a header, content, and a footer. I am using TextEdit on my Mac and saving the file with a .HTML extension.

A: 

I assume you have some ability to run a scripting language on your host, so just write a header and footer file, and include those in your content page with your dynamic language of choice.

Alex Fort
+3  A: 

You can go through the 3+3 tutorials for HTML and CSS on HTML Dog.

cherouvim
RTFM is hardly a good answer.
Sunny
@Sunny: The question was very basic and my answer did not have any RTFM tone in it :)
cherouvim
Undoing the downvote, as the OP accepts this, but still its better to provide a solution :)
Sunny
@Sunny: Thanks. I still think that in this case the solution is to point the author to the tutorial itself instead of trying to guess what he means or copy pasting huge tutorial sections in here.
cherouvim
A: 

create an html file paste this frames :

<html>

<frameset rows="25%,50%,25%">

  <frame src="header.htm">
  <frame src="content.htm">
  <frame src="footer.htm">

</frameset>

</html>

and then create your header, content and footer files in same directory.

Canavar
Ugh, Frames?!? Blasphemy
Chris Ballance
Sweet god almighty, I thought we eradicated this like Polio!
Rex M
Yes, frames suck but it's the only way to do modularization in a static html environment. So ++
cherouvim
No one is asking about file modularization. So this is heaping bad upon bad.
Rex M
@Rex M: The question was very vague and it was not clear what the intention was.
cherouvim
@Rex M : strange people, he is not asking about file modularization, ok, but not asking for one and only one file.. it's an answer, and not wrong, like or dislike..
Canavar
A: 
<html>
<head><title>my title</title></head>

<h1>My Header</h1>

<p>The quick brown fox jumps over the lazy dog.</p>

<h4>My footer</h4>
</html>

my title

My Header

The quick brown fox jumps over the lazy dog.

My footer


Optionally, you can put each section in a separate file, or specifically the header and footer in separate files to be reused.

Chris Ballance
A: 

If your web server is Apache (I would guess on Mac), you can use server-side includes:

<html>
.....
<body>
<!--#include virtual="myheader.html" --> 

YOUR CONTENT GOES HERE

<!--#include virtual="myfooter.html" --> 
</body>
Sunny