---
title: "set header and footer with in master page"  
description: "set header and footer with in master page"  
author: "Anonymous User"  
published: 2013-03-12  
updated: 2013-03-12  
canonical: https://www.mindstick.com/forum/649/set-header-and-footer-with-in-master-page  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 1 minute  

---

# set header and footer with in master page

Hi Everyone!

I want to create [header](https://www.mindstick.com/articles/336036/explain-about-html-header-body-and-footer-tags) and footer for my [master page](https://www.mindstick.com/blog/258/set-property-value-on-master-page-from-content-page). [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is that, When I have set div with as 100%, When we resize [window](https://www.mindstick.com/forum/161285/how-does-the-window-console-object-work-in-javascript) then header contain

disturbed. When I have set div with in px then it's behave differ for every browsers. Pleas tell me how to manage it.

my line of [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) as below\
<[body](https://yourviews.mindstick.com/story/2120/rare-species-having-electricity-in-their-body)>\
<div [style](https://www.mindstick.com/articles/126300/apa-citation-style-get-to-know-about-it-for-your-next-assignment)="header"></div>\
<div style="contain"></div>\
<div style="footer"></div>\
</body>

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Ezra!

Put your div into another div and set that backgorund color same as you fixed main div.\
e.g.

<style type="text/css">\
.maindiv\
{\
width: 100%;\
background-color: #e5e5e5; \
margin: -8px -8px 0px -8px;\
}\
.innerdiv\
{\
width: 1200px;\
height: 100px;\
background-color: #e5e5e5;\
margin: 0px auto 0px auto;\
}\
</style>

<div class="maindiv">\
<div class="innerdiv">\
</div>\
</div>


---

Original Source: https://www.mindstick.com/forum/649/set-header-and-footer-with-in-master-page

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
