Family Tree Tips ~ Set Page Background

  • Skill Level: Advanced and Intermediate
  • FH versions: V5, V6, and V7
  • In Topics: Creating a website 


The default background for every page is defined in the fhstyle.css file as plain white, but can be defined in the Wizard Step 7 – Presentation and Behaviour via its Colours button Background setting.

Also the colour can be changed, or an image substituted, in the few simple steps outlined below. This technique is also used by Family Tree Tips ~ Alter CSS Default Style for text fonts, etc.

Insert HTML Head Code

In the Wizard Family Tree Wizard ~ Step 8 – Final Details click the Advanced button and insert the following HTML code at the end of the <head> section:

<link rel="stylesheet" type="text/css" href="custom/mystyle.css"

where mystyle.css is your CSS file created in the next step. Subsequently, by changing this one CSS file, the style of all the web pages can be altered without rebuilding any of them.

If the website is to be viewed on mobile phones or tablets then also insert the following HTML code:

<meta name="viewport" content="width=device-width, initial-scale=1">

Add CSS Script

Something similar to the following CSS statement must be placed in a plain text file named mystyle.css which must be included in the …\Public\FH CD-DVD\data\custom folder or the …\Public\FH Web Page\custom folder:

body { background: #C0D0F0 url("myimage.jpg") }

where the code #C0D0F0 (which represents pale blue) is a background colour to use if the image file is missing.

myimage.jpg is your background image file, or it could be a .png or .gif file, and must be included in the …\Public\FH CD-DVD\data\custom folder or the …\Public\FH Web Page\custom folder. It will be rendered on the the web page by tiling it repeatedly to fill the background.

Either the colour code #C0D0F0 or the image file url("myimage.jpg") may be omitted.

These background properties are explained at w3schools CSS Background.

Colour codes have several formats explained at w3schools HTML Colors and shown in an example below:

NAME: green
HEX: #008000
RGB: rgb(0,128,0)
RGB%: rgb(0%,50%,0%)

Placing your files in the custom subfolder prevents them from being deleted when the wizard recreates the pages.

Last update: 03 Feb 2021