I created a WordPress template and now I would like to use that template for several pages, however I would like to have different background color on some of the elements such as footer, header etc... which will depend on the parent.

So lets say I have PARENT A (green background) and PARENT B (white background) now when I will create child of PARENT A I would like it to have green background automatically. I know something similar could be done with posts using

You can do something along the lines of the code below, having a different div depending on the page id. Put the style in your CSS obviously, but this paints the picture. Put the code in whatever php file you're applying this to.