Uniform header across all web pages

Asked By 0 points N/A Posted on -
qa-featured

Hi All,

I am trying to get a uniformed header and sidebar in all the pages of a website. Am wondering whether it is possible in simple HTML.
SHARE
Best Answer by Josephm
Best Answer
Best Answer
Answered By 0 points N/A #119612

Uniform header across all web pages

qa-featured

 

Hello!
 
Your Question;
 
How to get a uniform header and sidebar in all the pages of a website; is it possible in simple HTML?
 
The answer is No.
 
If you are coding in ASP.NET then you can do it by making master pages because master pages work as template. You would have to include the template in your forms and you would see that you will get the same header and sidebars in all the forms in which you have included the master pages.
 
If you are coding in PHP, you can do it by creating a header. PHP and sidebar.php separately. After that you will want to include the two .PHP pages in your general pages. See example below:
 
<html>
 
<head>
 
<title>My Page</title>
 
</head>
 
<body>
 
<?PHP include("header.php");
 
include("sidebar.php");
 
?>
 
</body>
 
</html>
 
When you use these codes, you will get a formal solution such that whenever you modify codes in the header or sidebar.php, those changes are reflected on all pages.
 
The same happens with the Master page in .NET
 
However, there is no way to implement this in HTML; you will have to use or hand-code it in all pages.
Answered By 0 points N/A #119613

Uniform header across all web pages

qa-featured

 

Hi Ashfaqmb!
 
I really do not know the solution to this, but I did some research just to help you. Anyway, I have a solution – Use the include tag to create a template for your page.
 
A template page allows you to create shared headers, footers, or in-betweenness for your pages where the content is all the same. Then you will only need to update one file, your new logo, new copyright date, or new design and it will update on all your pages at once.
 
This should help. Let me know what works for you.
 
Thanks.

Login/Register to Answer

Related Questions