Joseph Burley
Joseph Burley

Reputation: 373

Website Header in HTML

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.

Upvotes: 1

Views: 5610

Answers (5)

Sunny Milenov
Sunny Milenov

Reputation: 22310

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>

Upvotes: 0

Chris Ballance
Chris Ballance

Reputation: 34347

<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.

Upvotes: 0

Canavar
Canavar

Reputation: 48088

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.

Upvotes: 0

cherouvim
cherouvim

Reputation: 31903

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

Upvotes: 3

Alex Fort
Alex Fort

Reputation: 18821

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.

Upvotes: 0

Related Questions