Google Docs: How to Add and Stylize Header and Footer

Non expert Google Docs users such as myself spend much time on Google docs without using many of it’s wonderful features. The reason for that is we do not really need these features in our day to day tasks. However, each user has different requirements and the features that I don’t use are most used features for other users. Today I was trying to add headers with page numbers, and footer on pages of a document that I prepared for a project. Since I never used these features before so I didn’t know how to do it and it took me some time to figure out these things. So I decided to add these things here for future reference and for other visitors who might come across similar situation and I hope this page will save them some time.

How To Add A Header to a Document in Google Docs:

It is extremely simple, go to Insert > Header and you see header is inserted in your document. If you want to add a footer too then go to Insert > Footer and you have footer. Now when you print your document you see that the header and footer are repeated on each page.

How to add page number to Header or Footer in Google Docs:

Go to File > Print Settings. Under the Annotations heading check the box to Include page numbers and select the position where you want page number to appear. If you select Top right, center, or left then page numbers will appear in header. If you select Bottom right, left or center then page numbers will appear in footer.

Google Docs Print Settings

Google Docs Print Settings

How To Format or change style of the Header and Footer in Google Docs:

There might be some other easier way to do this but the method I found is easier and flexible to my needs. My method is to edit the CSS. When you add Header or Footer in your Document Google Docs gives header the id and class of google_header. Same goes for footer with a class or id of google_footer. But to make sure that this is right you better check the HTML view of your document. Go to Edit > Edit HTML and you will see something like this in the begining of your document:


<div class="google_header" id="google_header">
<p id="d1pj"></p>
</div>
At the end of your document's HTML view you will see something like this:
<div class="google_footer" id="google_footer">

We will use the value in either class or id attributes to stylize our header and footer. Go to Edit > Edit CSS. A text box will appear where you can set style for your Header and footer. I used this style:


#google_header {
border: 3px solid #eee;
font-size: small;
color: #ccc;
}

#google_footer {
border: 3px solid #eee;
font-size: small;
color: #ccc;
}

Now when we click on the Print button we get a document with nice header and footer with page numbers on each page.

gplus-profile-picture